Bug 1388145 - Initialize the Windows Jump Lists from an idle callback. r=florian draft
authorFelipe Gomes <felipc@gmail.com>
Wed, 09 Aug 2017 15:44:28 -0300
changeset 643425 ababa118265f4257bcd397cfd811be41981782fc
parent 643424 85f4e26d727a042091c5a8e5f9b9c346604d6029
child 643426 fe007e2a7fa8812196e9a7c121a7eb0686b5d9c2
push id73095
push userfelipc@gmail.com
push dateWed, 09 Aug 2017 18:46:00 +0000
reviewersflorian
bugs1388145
milestone57.0a1
Bug 1388145 - Initialize the Windows Jump Lists from an idle callback. r=florian MozReview-Commit-ID: FvDPNHGL3Ou
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -889,27 +889,16 @@ BrowserGlue.prototype = {
     // handler and init message manager child shim for privileged api access.
     // With older versions of the extension installed, this load will fail
     // passively.
     Services.ppmm.loadProcessScript("resource://pdf.js/pdfjschildbootstrap.js", true);
     if (PdfJs.enabled) {
       Services.ppmm.loadProcessScript("resource://pdf.js/pdfjschildbootstrap-enabled.js", true);
     }
 
-    if (AppConstants.platform == "win") {
-      // For Windows 7, initialize the jump list module.
-      const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
-      if (WINTASKBAR_CONTRACTID in Cc &&
-          Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
-        let temp = {};
-        Cu.import("resource:///modules/WindowsJumpLists.jsm", temp);
-        temp.WinTaskbarJumpList.startup();
-      }
-    }
-
     TabCrashHandler.init();
     if (AppConstants.MOZ_CRASHREPORTER) {
       PluginCrashReporter.init();
     }
 
     ProcessHangMonitor.init();
 
     // A channel for "remote troubleshooting" code...
@@ -1152,16 +1141,29 @@ BrowserGlue.prototype = {
     }, 5000);
 
     if (AppConstants.MOZ_CRASHREPORTER) {
       Services.tm.idleDispatchToMainThread(() => {
         UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
       });
     }
 
+    if (AppConstants.platform == "win") {
+      Services.tm.idleDispatchToMainThread(() => {
+        // For Windows 7, initialize the jump list module.
+        const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
+        if (WINTASKBAR_CONTRACTID in Cc &&
+            Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
+          let temp = {};
+          Cu.import("resource:///modules/WindowsJumpLists.jsm", temp);
+          temp.WinTaskbarJumpList.startup();
+        }
+      });
+    }
+
     Services.tm.idleDispatchToMainThread(() => {
       this._checkForDefaultBrowser();
     });
   },
 
   /**
    * Use this function as an entry point to schedule tasks that need
    * to run once per session, at any arbitrary point in time.