Bug 1380205 - Check preferences version for some openPreferences calls need to direct to different pane in different version. r=mconley
authorEvan Tseng <evan@tseng.io>
Wed, 12 Jul 2017 09:01:25 +0800
changeset 369182 299ad6c757d75cb4c0bed80847727d7eb7b9fdf6
parent 369181 820a85e09ac38f45cbd78ccf57e2a4e37db1eae6
child 369183 c94795e8415360b8e192a2c47874d811e5614026
push id46584
push userryanvm@gmail.com
push dateMon, 17 Jul 2017 15:42:36 +0000
treeherderautoland@299ad6c757d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1380205
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1380205 - Check preferences version for some openPreferences calls need to direct to different pane in different version. r=mconley MozReview-Commit-ID: DFltTFRkPrA
browser/base/content/browser-media.js
browser/components/newtab/NewTabSearchProvider.jsm
browser/components/nsBrowserGlue.js
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -163,17 +163,23 @@ var gEMEHandler = {
       Services.prefs.setBoolPref(firstPlayPref, true);
     } else {
       document.getElementById(anchorId).removeAttribute("firstplay");
     }
 
     let mainAction = {
       label: gNavigatorBundle.getString(btnLabelId),
       accessKey: gNavigatorBundle.getString(btnAccessKeyId),
-      callback() { openPreferences("panePrivacy", {origin: "browserMedia"}); },
+      callback() {
+        if (Services.prefs.getBoolPref("browser.preferences.useOldOrganization")) {
+          openPreferences("paneContent", {origin: "browserMedia"});
+        } else {
+          openPreferences("panePrivacy", {origin: "browserMedia"});
+        }
+      },
       dismiss: true
     };
     let options = {
       dismissed: true,
       eventCallback: aTopic => aTopic == "swapping",
       learnMoreURL: Services.urlFormatter.formatURLPref("app.support.baseURL") + "drm-content",
     };
     PopupNotifications.show(browser, "drmContentPlaying", message, anchorId, mainAction, null, options);
--- a/browser/components/newtab/NewTabSearchProvider.jsm
+++ b/browser/components/newtab/NewTabSearchProvider.jsm
@@ -63,17 +63,21 @@ SearchProvider.prototype = {
   },
 
   removeFormHistory({browser}, suggestion) {
     ContentSearch.removeFormHistoryEntry({target: browser}, suggestion);
   },
 
   manageEngines(browser) {
     const browserWin = browser.ownerGlobal;
-    browserWin.openPreferences("paneGeneral", { origin: "contentSearch" });
+    if (Services.prefs.getBoolPref("browser.preferences.useOldOrganization")) {
+      browserWin.openPreferences("paneSearch", { origin: "contentSearch" });
+    } else {
+      browserWin.openPreferences("paneGeneral", { origin: "contentSearch" });
+    }
   },
 
   async asyncGetState() {
     let state = await ContentSearch.currentStateObj(true);
     return state;
   },
 
   async asyncPerformSearch({browser}, searchData) {
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -313,17 +313,21 @@ BrowserGlue.prototype = {
     Cu.import("resource://services-sync/main.js");
     Weave.Service.scheduler.delayedAutoConnect(delay);
   },
 
   // nsIObserver implementation
   observe: function BG_observe(subject, topic, data) {
     switch (topic) {
       case "notifications-open-settings":
-        this._openPreferences("privacy", { origin: "notifOpenSettings" });
+        if (Services.prefs.getBoolPref("browser.preferences.useOldOrganization")) {
+          this._openPreferences("content", { origin: "notifOpenSettings" });
+        } else {
+          this._openPreferences("privacy", { origin: "notifOpenSettings" });
+        }
         break;
       case "prefservice:after-app-defaults":
         this._onAppDefaults();
         break;
       case "final-ui-startup":
         this._beforeUIStartup();
         break;
       case "browser-delayed-startup-finished":