Closed Bug 518054 Opened 11 years ago Closed 11 years ago

nsPromptService needs to fire event when opening modal dialogs

Categories

(Firefox for Android Graveyard :: General, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
fennec1.0b5

People

(Reporter: mfinkle, Assigned: fabrice.desre)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 515213 is adding code to handle events fired when dialogs are opened. However, the new nsPromptService doesn't fire those events. We need too fire the "DOMWillOpenModalDialog" and "DOMModalDialogClosed" events.

See where nsAutoWindowStateHelper is used in the default nsPromptService:
http://mxr.mozilla.org/mozilla-central/ident?i=nsAutoWindowStateHelper
tracking-fennec: --- → ?
Assignee: nobody → fabrice.desre
Attached patch fix (obsolete) — Splinter Review
Attachment #402095 - Flags: review?(mark.finkle)
The event should be fired on the window that's triggering the prompt, no? Just firing the event at the tabbrowser doesn't seem useful for the purposes of bug 515213.
Oh, I forgot that our getBrowser() is different and returns the selected <browser>. Still, is isn't it possible for the prompt to be opened by a background <browser>?
Attachment #402095 - Flags: review?(mark.finkle) → review-
Comment on attachment 402095 [details] [diff] [review]
fix

Can you add a helper method to nsPromptService to fire an event, which is passed into it?
(In reply to comment #4)
> (From update of attachment 402095 [details] [diff] [review])
> Can you add a helper method to nsPromptService to fire an event, which is
> passed into it?

That way we can use the "aParent" window passed into the methods
Attached patch new patchSplinter Review
New patch with the following modifications :
- the parent window is used to dispatch the event, or getBrowser() if aParent is null
- to get this to work with all modal dialogs (and not only nsPromptService) the signature of importDialog has changed.
Attachment #402095 - Attachment is obsolete: true
Attachment #405866 - Flags: review?(mark.finkle)
Attachment #405866 - Flags: review?(mark.finkle) → review+
pushed:
https://hg.mozilla.org/mobile-browser/rev/b8146a648664
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → B5
tracking-fennec: ? → ---
You need to log in before you can comment on or make changes to this bug.