Closed Bug 518054 Opened 11 years ago Closed 11 years ago
Prompt Service needs to fire event when opening modal dialogs
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
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
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 #405866 - Flags: review?(mark.finkle) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → B5
You need to log in before you can comment on or make changes to this bug.