Closed Bug 597244 Opened 14 years ago Closed 14 years ago

re-work PopupNotifications event callback API

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- beta7+

People

(Reporter: Gavin, Assigned: Gavin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [doorhanger])

Attachments

(1 file)

Bug 590794 added a "dismissalHandler", and bug 595253 has a patch adding a "shown" handler. A "removed" handler is potentially useful as well. Rather than have the caller specify separate callbacks for all of these events, we should consolidate and have a single "eventHandler" callback that gets called for each of the events, with a parameter. Bug 590794 doesn't have any users yet (was just added recently), so I think we can make this change without affecting any users (but we need to do it soon).
Attached patch patchSplinter Review
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #476078 - Flags: review?(dolske)
Attachment #476078 - Flags: review?(dolske) → review+
blocking+ since this is an API change.
blocking2.0: --- → beta7+
If I understand correctly, the "removed" event won't be called when you close a tab or the window. In bug 588266 a cleanup function (cancel add-on installation) needs to be called if the user didn't click on the main action of the notification. As of now, the cleanup function in called from the dismissal callback introduced in bug 590794, but there's a drawback: the notification is removed when dismissed, so you can't dismiss it and install the add-on later. Using the "removed" event would fix that issue, but it would need to be fired in all situations where the user didn't accept the notification (tab or window is closed, location change, ...). I could open a followup bug if that's reasonable to have such semantic for the "removed" event.
Yeah, please do file a followup. We may be able to fix that by having browsers remove() their notifications in their destructor, or something along those lines.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b7
Blocks: 609804
(In reply to comment #4) > Yeah, please do file a followup. We may be able to fix that by having browsers > remove() their notifications in their destructor, or something along those > lines. I filed bug 609804 for that.
Whiteboard: [doorhanger]
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: