Bug 1634384 - Port bug 1632854: Pass the ChromeWindow reference to the OSKeyStore instead of the content global so the dialog will be app modal. r=mkmelin
authorRichard Marti <richard.marti@gmail.com>
Thu, 30 Apr 2020 15:00:23 +0200
changeset 39008 5838625b40ad29ac776d77374c25b0f2a0104e32
parent 39007 d7f83a840c2c030c2999a88b92993af66f4da219
child 39009 a888cc00988ff7b4a21dbd05178cd0d2a055b063
push id401
push userclokep@gmail.com
push dateMon, 01 Jun 2020 20:41:59 +0000
reviewersmkmelin
bugs1634384, 1632854
Bug 1634384 - Port bug 1632854: Pass the ChromeWindow reference to the OSKeyStore instead of the content global so the dialog will be app modal. r=mkmelin Port of https://hg.mozilla.org/mozilla-central/rev/2569411eb193
mail/components/preferences/passwordManager.js
mail/components/preferences/privacy.js
--- a/mail/components/preferences/passwordManager.js
+++ b/mail/components/preferences/passwordManager.js
@@ -787,20 +787,21 @@ async function masterPasswordLogin(noPas
       let [messageText, captionText] = await L10n.formatMessages([
         {
           id: messageId,
         },
         {
           id: "password-os-auth-dialog-caption",
         },
       ]);
+      let win = Services.wm.getMostRecentWindow("");
       let loggedIn = await OSKeyStore.ensureLoggedIn(
         messageText.value,
         captionText.value,
-        window,
+        win,
         false
       );
       if (!loggedIn.authenticated) {
         return false;
       }
       return true;
     }
     return noPasswordCallback ? noPasswordCallback() : true;
--- a/mail/components/preferences/privacy.js
+++ b/mail/components/preferences/privacy.js
@@ -341,20 +341,21 @@ var gPrivacyPane = {
       let [messageText, captionText] = await L10n.formatMessages([
         {
           id: messageId,
         },
         {
           id: "master-password-os-auth-dialog-caption",
         },
       ]);
+      let win = Services.wm.getMostRecentWindow("");
       let loggedIn = await OSKeyStore.ensureLoggedIn(
         messageText.value,
         captionText.value,
-        window,
+        win,
         false
       );
       if (!loggedIn.authenticated) {
         return;
       }
     }
 
     gSubDialog.open(