From 4d135723d8be40c8657145beb6af80fbb2f971ff Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Wed, 10 Sep 2014 13:53:10 +0200 Subject: [PATCH] Bug 1064885: add prompt to encourage Nightly users to enable e10s, r=felipe --HG-- extra : rebase_source : cf288b2d3b80c540bcc0ba4d2e2caae8b7a95925 --- browser/components/nsBrowserGlue.js | 58 ++++++++++++++++++++++++++- browser/themes/linux/jar.mn | 3 ++ browser/themes/linux/moz.build | 4 +- browser/themes/osx/jar.mn | 3 ++ browser/themes/osx/moz.build | 4 +- browser/themes/shared/e10s-64@2x.png | Bin 0 -> 20737 bytes browser/themes/windows/jar.mn | 6 +++ browser/themes/windows/moz.build | 4 +- testing/profiles/prefs_general.js | 3 ++ 9 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 browser/themes/shared/e10s-64@2x.png diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 5002aff126e3..bb11ad388bed 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -2263,6 +2263,22 @@ let E10SUINotification = { if (!activationNoticeShown) { this._showE10sActivatedNotice(); } + } else { + let e10sPromptShownCount = 0; + try { + e10sPromptShownCount = Services.prefs.getIntPref("browser.displayedE10SPrompt"); + } catch(e) {} + + if (!Services.appinfo.inSafeMode && e10sPromptShownCount < 5) { + Services.tm.mainThread.dispatch(() => { + try { + this._showE10SPrompt(); + Services.prefs.setIntPref("browser.displayedE10SPrompt", e10sPromptShownCount + 1); + } catch (ex) { + Cu.reportError("Failed to show e10s prompt: " + ex); + } + }, Ci.nsIThread.DISPATCH_NORMAL); + } } }, @@ -2287,7 +2303,47 @@ let E10SUINotification = { nb.appendNotification(message, "e10s-activated-noticed", null, nb.PRIORITY_WARNING_MEDIUM, buttons); - } + }, + + _showE10SPrompt: function BG__showE10SPrompt() { + let win = RecentWindow.getMostRecentBrowserWindow(); + if (!win) + return; + + let browser = win.gBrowser.selectedBrowser; + + let promptMessage = "Would you like to help us test multiprocess Nightly (e10s)? You can also enable e10s in Nightly preferences."; + let mainAction = { + label: "Enable and Restart", + accessKey: "E", + callback: function () { + Services.prefs.setBoolPref("browser.tabs.remote.autostart", true); + Services.prefs.setBoolPref("browser.enabledE10SFromPrompt", true); + // Restart the app + let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool); + Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart"); + if (cancelQuit.data) + return; // somebody canceled our quit request + Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart); + } + }; + let secondaryActions = [ + { + label: "No thanks", + accessKey: "N", + callback: function () { + Services.prefs.setIntPref("browser.displayedE10SPrompt", 5); + } + } + ]; + let options = { + popupIconURL: "chrome://browser/skin/e10s-64@2x.png", + learnMoreURL: "https://wiki.mozilla.org/Electrolysis", + persistWhileVisible: true + }; + + win.PopupNotifications.show(browser, "enable_e10s", promptMessage, null, mainAction, secondaryActions, options); + }, }; #endif diff --git a/browser/themes/linux/jar.mn b/browser/themes/linux/jar.mn index bc1a7d6be285..6c80ecc5dd41 100644 --- a/browser/themes/linux/jar.mn +++ b/browser/themes/linux/jar.mn @@ -383,3 +383,6 @@ browser.jar: skin/classic/browser/devtools/tooltip/arrow-horizontal-light@2x.png (../shared/devtools/tooltip/arrow-horizontal-light@2x.png) skin/classic/browser/devtools/tooltip/arrow-vertical-light.png (../shared/devtools/tooltip/arrow-vertical-light.png) skin/classic/browser/devtools/tooltip/arrow-vertical-light@2x.png (../shared/devtools/tooltip/arrow-vertical-light@2x.png) +#ifdef E10S_TESTING_ONLY + skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) +#endif diff --git a/browser/themes/linux/moz.build b/browser/themes/linux/moz.build index 6a7af20adda0..492ddbe2bb9f 100644 --- a/browser/themes/linux/moz.build +++ b/browser/themes/linux/moz.build @@ -6,4 +6,6 @@ DIRS += ['communicator'] -JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file +DEFINES['E10S_TESTING_ONLY'] = CONFIG['E10S_TESTING_ONLY'] + +JAR_MANIFESTS += ['jar.mn'] diff --git a/browser/themes/osx/jar.mn b/browser/themes/osx/jar.mn index 307a58cb5189..12179c219d75 100644 --- a/browser/themes/osx/jar.mn +++ b/browser/themes/osx/jar.mn @@ -542,6 +542,9 @@ browser.jar: skin/classic/browser/devtools/tooltip/arrow-horizontal-light@2x.png (../shared/devtools/tooltip/arrow-horizontal-light@2x.png) skin/classic/browser/devtools/tooltip/arrow-vertical-light.png (../shared/devtools/tooltip/arrow-vertical-light.png) skin/classic/browser/devtools/tooltip/arrow-vertical-light@2x.png (../shared/devtools/tooltip/arrow-vertical-light@2x.png) +#ifdef E10S_TESTING_ONLY + skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) +#endif % override chrome://browser/skin/toolbarbutton-dropmarker.png chrome://browser/skin/lion/toolbarbutton-dropmarker.png os=Darwin osversion>=10.7 % override chrome://browser/skin/tabbrowser/alltabs-box-bkgnd-icon.png chrome://browser/skin/lion/tabbrowser/alltabs-box-bkgnd-icon.png os=Darwin osversion>=10.7 diff --git a/browser/themes/osx/moz.build b/browser/themes/osx/moz.build index 6a7af20adda0..492ddbe2bb9f 100644 --- a/browser/themes/osx/moz.build +++ b/browser/themes/osx/moz.build @@ -6,4 +6,6 @@ DIRS += ['communicator'] -JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file +DEFINES['E10S_TESTING_ONLY'] = CONFIG['E10S_TESTING_ONLY'] + +JAR_MANIFESTS += ['jar.mn'] diff --git a/browser/themes/shared/e10s-64@2x.png b/browser/themes/shared/e10s-64@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..1dc243865cfb412f03aa372d30fa769fd3fd5eac GIT binary patch literal 20737 zcmeI4c|4Te+rV#23`vqS2@O#cW=4ZCWEo`1*cFu+V=&nnTh?SLYh)?1C6qNvL`a@U zQpJJU&*yV@*2qA61E&Bd z000|wbu>-D?@-zggbn=Ntb(V2UmWf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cmV?d00001 diff --git a/browser/themes/windows/jar.mn b/browser/themes/windows/jar.mn index 87ac313b224e..55fab3d0c6b6 100644 --- a/browser/themes/windows/jar.mn +++ b/browser/themes/windows/jar.mn @@ -420,6 +420,9 @@ browser.jar: skin/classic/browser/devtools/tooltip/arrow-horizontal-light@2x.png (../shared/devtools/tooltip/arrow-horizontal-light@2x.png) skin/classic/browser/devtools/tooltip/arrow-vertical-light.png (../shared/devtools/tooltip/arrow-vertical-light.png) skin/classic/browser/devtools/tooltip/arrow-vertical-light@2x.png (../shared/devtools/tooltip/arrow-vertical-light@2x.png) +#ifdef E10S_TESTING_ONLY + skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) +#endif #ifdef XP_WIN browser.jar: @@ -841,6 +844,9 @@ browser.jar: skin/classic/aero/browser/devtools/tooltip/arrow-horizontal-light@2x.png (../shared/devtools/tooltip/arrow-horizontal-light@2x.png) skin/classic/aero/browser/devtools/tooltip/arrow-vertical-light.png (../shared/devtools/tooltip/arrow-vertical-light.png) skin/classic/aero/browser/devtools/tooltip/arrow-vertical-light@2x.png (../shared/devtools/tooltip/arrow-vertical-light@2x.png) +#ifdef E10S_TESTING_ONLY + skin/classic/aero/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) +#endif % override chrome://browser/skin/Toolbar.png chrome://browser/skin/Toolbar-aero.png os=WINNT osversion=6 % override chrome://browser/skin/Toolbar.png chrome://browser/skin/Toolbar-aero.png os=WINNT osversion=6.1 diff --git a/browser/themes/windows/moz.build b/browser/themes/windows/moz.build index 6a7af20adda0..492ddbe2bb9f 100644 --- a/browser/themes/windows/moz.build +++ b/browser/themes/windows/moz.build @@ -6,4 +6,6 @@ DIRS += ['communicator'] -JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file +DEFINES['E10S_TESTING_ONLY'] = CONFIG['E10S_TESTING_ONLY'] + +JAR_MANIFESTS += ['jar.mn'] diff --git a/testing/profiles/prefs_general.js b/testing/profiles/prefs_general.js index 641f1319a97c..dcdd7914643a 100644 --- a/testing/profiles/prefs_general.js +++ b/testing/profiles/prefs_general.js @@ -250,3 +250,6 @@ user_pref("loop.throttled", false); // Ensure UITour won't hit the network user_pref("browser.uitour.pinnedTabUrl", "http://%(server)s/uitour-dummy/pinnedTab"); user_pref("browser.uitour.url", "http://%(server)s/uitour-dummy/tour"); + +// Don't prompt about e10s +user_pref("browser.displayedE10SPrompt", 5);