Closed Bug 882495 Opened 12 years ago Closed 12 years ago

PermissionPromptHandler does not return the correct window on Android

Categories

(Core :: DOM: Core & HTML, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox25 --- fixed

People

(Reporter: stully, Assigned: stully)

References

Details

Attachments

(1 file)

When called by ContactManager, the window returned by getMostRecentWindow() is not correct which causes problems when trying to display a content permission prompt on Android.
This works for the ContactManager case, but I assume that this will break anything else that utilizes PermissionPromptHelper; not sure how to handle this.
Assignee: nobody → stully
Attachment #761801 - Flags: feedback?(jonas)
Blocks: 857730
Comment on attachment 761801 [details] [diff] [review] Get window for permission prompt by outer window ID instead of most recent window Changing to review since the tests passed: https://tbpl.mozilla.org/?tree=Try&rev=30609e528de0
Attachment #761801 - Flags: feedback?(jonas) → review?(jonas)
Comment on attachment 761801 [details] [diff] [review] Get window for permission prompt by outer window ID instead of most recent window >From: Shane Tully <stully@mozilla.com> >Bug 882495: Get window for permission prompt by outer window ID instead of most recent window > >diff --git a/dom/contacts/ContactManager.js b/dom/contacts/ContactManager.js >--- a/dom/contacts/ContactManager.js >+++ b/dom/contacts/ContactManager.js >@@ -730,17 +730,18 @@ ContactManager.prototype = { > > let principal = this._window.document.nodePrincipal; > cpmm.sendAsyncMessage("PermissionPromptHelper:AskPermission", { > type: "contacts", > access: access, > requestID: requestID, > origin: principal.origin, > appID: principal.appId, >- browserFlag: principal.isInBrowserElement >+ browserFlag: principal.isInBrowserElement, >+ windowID: this._window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).outerWindowID > }); > }, > > save: function save(aContact) { > let request; > if (DEBUG) debug("save: " + JSON.stringify(aContact) + " :" + aContact.id); > let newContact = {}; > newContact.properties = { >diff --git a/dom/permission/PermissionPromptHelper.jsm b/dom/permission/PermissionPromptHelper.jsm >--- a/dom/permission/PermissionPromptHelper.jsm >+++ b/dom/permission/PermissionPromptHelper.jsm >@@ -81,17 +81,17 @@ this.PermissionPromptHelper = { > // create a nsIContentPermissionRequest > let request = { > type: msg.type, > access: msg.access ? msg.access : "unused", > principal: principal, > QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionRequest]), > allow: aCallbacks.allow, > cancel: aCallbacks.cancel, >- window: Services.wm.getMostRecentWindow("navigator:browser") >+ window: Services.wm.getOuterWindowWithId(msg.windowID) > }; > > permissionPromptService.getPermission(request); > return; > } > > if (permValue == Ci.nsIPermissionManager.ALLOW_ACTION) { > aCallbacks.allow();
Attachment #761801 - Flags: review?(jonas) → review?(anygregor)
Attachment #761801 - Flags: review?(anygregor) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: