Bug 767313 - Merge the Tabs category into the General category in in-content preferences. r=Unfocused
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 11 Sep 2013 13:22:44 +1200
changeset 159418 df6621bc6442b37ba837b41894d7ed8dc7119c17
parent 159417 8bceed557a76fe0af34ebec67588e848ecfda13f
child 159419 4c2ec5c33ea95181b2e9ae0592969aaaa28550da
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs767313
milestone26.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 767313 - Merge the Tabs category into the General category in in-content preferences. r=Unfocused
browser/components/preferences/in-content/jar.mn
browser/components/preferences/in-content/landing.xul
browser/components/preferences/in-content/main.js
browser/components/preferences/in-content/main.xul
browser/components/preferences/in-content/preferences.js
browser/components/preferences/in-content/preferences.xul
browser/components/preferences/in-content/tabs.js
browser/components/preferences/in-content/tabs.xul
browser/locales/en-US/chrome/browser/preferences/tabs.dtd
browser/themes/linux/preferences/in-content/preferences.css
browser/themes/osx/preferences/in-content/preferences.css
browser/themes/windows/preferences/in-content/preferences.css
--- a/browser/components/preferences/in-content/jar.mn
+++ b/browser/components/preferences/in-content/jar.mn
@@ -1,20 +1,18 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 browser.jar:
-*  content/browser/preferences/in-content/preferences.js
+   content/browser/preferences/in-content/preferences.js
    content/browser/preferences/in-content/landing.xul
 *  content/browser/preferences/in-content/preferences.xul
 *  content/browser/preferences/in-content/main.xul
-   content/browser/preferences/in-content/main.js
-*  content/browser/preferences/in-content/tabs.xul
-*  content/browser/preferences/in-content/tabs.js
+*  content/browser/preferences/in-content/main.js
    content/browser/preferences/in-content/privacy.xul
 *  content/browser/preferences/in-content/privacy.js
 *  content/browser/preferences/in-content/advanced.xul
 *  content/browser/preferences/in-content/advanced.js
    content/browser/preferences/in-content/applications.xul
 *  content/browser/preferences/in-content/applications.js
    content/browser/preferences/in-content/content.xul
    content/browser/preferences/in-content/content.js
--- a/browser/components/preferences/in-content/landing.xul
+++ b/browser/components/preferences/in-content/landing.xul
@@ -8,21 +8,17 @@
   <hbox id="preferences-home" flex="1">
 
     <button label="&paneGeneral.title;" class="landingButton"
             oncommand="gotoPref('paneGeneral');">
       <image class="landingButton-icon" type="general"/>
       <label class="landingButton-label">&paneGeneral.title;</label>
     </button>
 
-    <button label="&paneTabs.title;" class="landingButton"
-            oncommand="gotoPref('paneTabs');">
-      <image class="landingButton-icon" type="tabs"/>
-      <label class="landingButton-label">&paneTabs.title;</label>
-    </button>
+
 
     <button label="&paneContent.title;" class="landingButton"
             oncommand="gotoPref('paneContent');">
       <image class="landingButton-icon" type="content"/>
       <label class="landingButton-label">&paneContent.title;</label>
     </button>
 
     <button label="&paneApplications.title;" class="landingButton"
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -1,37 +1,47 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
                                   "resource:///modules/DownloadsCommon.jsm");
 
 var gMainPane = {
-  _pane: null,
-
   /**
    * Initialization of this.
    */
   init: function ()
   {
-    this._pane = document.getElementById("paneMain");
-
     // set up the "use current page" label-changing listener
     this._updateUseCurrentButton();
     window.addEventListener("focus", this._updateUseCurrentButton.bind(this), false);
 
     this.updateBrowserStartupLastSession();
 
     this.setupDownloadsWindowOptions();
 
     // Notify observers that the UI is now ready
     Components.classes["@mozilla.org/observer-service;1"]
               .getService(Components.interfaces.nsIObserverService)
               .notifyObservers(window, "main-pane-loaded", null);
+
+    //Functionality for "Show tabs in taskbar" on Win XP
+
+#ifdef XP_WIN
+    try {
+      let sysInfo = Cc["@mozilla.org/system-info;1"].
+                    getService(Ci.nsIPropertyBag2);
+      let ver = parseFloat(sysInfo.getProperty("version"));
+      let showTabsInTaskbar = document.getElementById("showTabsInTaskbar");
+      showTabsInTaskbar.hidden = ver < 6.1 || (ver >= 6.1 && history.state != "tabs");
+    } catch (ex) {}
+
+#endif
+
   },
 
   setupDownloadsWindowOptions: function ()
   {
     let showWhenDownloading = document.getElementById("showWhenDownloading");
     let closeWhenDone = document.getElementById("closeWhenDone");
 
     // These radio buttons should be hidden when the Downloads Panel is enabled.
@@ -470,10 +480,33 @@ var gMainPane = {
       option.setAttribute("disabled", "true");
       if (option.selected) {
         menu.selectedItem = document.getElementById("browserStartupHomePage");
       }
     } else {
       option.removeAttribute("disabled");
       startupPref.updateElements(); // select the correct index in the startup menulist
     }
+  },
+  // TABS
+
+
+  /**
+   * Determines where a link which opens a new window will open.
+   *
+   * @returns |true| if such links should be opened in new tabs
+   */
+  readLinkTarget: function() {
+    var openNewWindow = document.getElementById("browser.link.open_newwindow");
+    return openNewWindow.value != 2;
+  },
+
+  /**
+   * Determines where a link which opens a new window will open.
+   *
+   * @returns 2 if such links should be opened in new windows,
+   *          3 if such links should be opened in new tabs
+   */
+  writeLinkTarget: function() {
+    var linkTargeting = document.getElementById("linkTargeting");
+    return linkTargeting.checked ? 3 : 2;
   }
 };
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -44,16 +44,57 @@
     <preference id="browser.download.dir"
                 name="browser.download.dir"
                 type="file"
                 onchange="gMainPane.displayDownloadDirPref();"/>
     <preference id="browser.download.folderList"
                 name="browser.download.folderList"
                 type="int"/>
 
+    <!-- Tab preferences 
+    Preferences:
+
+    browser.link.open_newwindow
+        1 opens such links in the most recent window or tab,
+        2 opens such links in a new window,
+        3 opens such links in a new tab
+    browser.tabs.loadInBackground
+    - true if display should switch to a new tab which has been opened from a
+      link, false if display shouldn't switch
+    browser.tabs.warnOnClose
+    - true if when closing a window with multiple tabs the user is warned and
+      allowed to cancel the action, false to just close the window
+    browser.tabs.warnOnOpen
+    - true if the user should be warned if he attempts to open a lot of tabs at
+      once (e.g. a large folder of bookmarks), false otherwise
+    browser.taskbar.previews.enable
+    - true if tabs are to be shown in the Windows 7 taskbar    
+    -->
+
+    <preference id="browser.link.open_newwindow"
+                name="browser.link.open_newwindow"
+                type="int"/>
+    <preference id="browser.tabs.loadInBackground"
+                name="browser.tabs.loadInBackground"
+                type="bool"
+                inverted="true"/>
+    <preference id="browser.tabs.warnOnClose"
+                name="browser.tabs.warnOnClose"
+                type="bool"/>
+    <preference id="browser.tabs.warnOnOpen"
+                name="browser.tabs.warnOnOpen"
+                type="bool"/>
+    <preference id="browser.sessionstore.restore_on_demand"
+                name="browser.sessionstore.restore_on_demand"
+                type="bool"/>
+#ifdef XP_WIN
+    <preference id="browser.taskbar.previews.enable"
+                name="browser.taskbar.previews.enable"
+                type="bool"/>
+#endif
 </preferences>
 
 <hbox class="heading" data-category="paneGeneral" hidden="true">
   <image class="preference-icon" type="general"/>
   <html:h1>&paneGeneral.title;</html:h1>
 </hbox>
 
 <!-- Startup -->
@@ -161,8 +202,47 @@
               onsynctopreference="return gMainPane.getFolderListPref();"/>
     </hbox>
     <radio id="alwaysAsk"
            value="false"
            label="&alwaysAsk.label;"
            accesskey="&alwaysAsk.accesskey;"/>
   </radiogroup>
 </groupbox>
+
+<!-- Tab preferences -->
+<groupbox data-category="paneGeneral" hidden="true">
+    <caption label="&tabsGroup.label;"/>
+    <checkbox id="linkTargeting" label="&newWindowsAsTabs.label;"
+              accesskey="&newWindowsAsTabs.accesskey;"
+              preference="browser.link.open_newwindow"
+              onsyncfrompreference="return gMainPane.readLinkTarget();"
+              onsynctopreference="return gMainPane.writeLinkTarget();"
+              class="indent"/>
+
+    <checkbox id="warnCloseMultiple" label="&warnCloseMultipleTabs.label;"
+              accesskey="&warnCloseMultipleTabs.accesskey;"
+              preference="browser.tabs.warnOnClose"
+              class="indent"/>
+
+    <checkbox id="warnOpenMany" label="&warnOpenManyTabs.label;"
+              accesskey="&warnOpenManyTabs.accesskey;"
+              preference="browser.tabs.warnOnOpen"
+              class="indent"/>
+
+    <checkbox id="restoreOnDemand" label="&restoreTabsOnDemand.label;"
+              accesskey="&restoreTabsOnDemand.accesskey;"
+              preference="browser.sessionstore.restore_on_demand"
+              class="indent"/>
+
+    <checkbox id="switchToNewTabs" label="&switchToNewTabs.label;"
+              accesskey="&switchToNewTabs.accesskey;"
+              preference="browser.tabs.loadInBackground"
+              class="indent"/>
+
+#ifdef XP_WIN
+    <checkbox id="showTabsInTaskbar" label="&showTabsInTaskbar.label;"
+              accesskey="&showTabsInTaskbar.accesskey;"
+              preference="browser.taskbar.previews.enable"
+              class="indent"/>
+#endif
+
+</groupbox>
--- a/browser/components/preferences/in-content/preferences.js
+++ b/browser/components/preferences/in-content/preferences.js
@@ -13,19 +13,16 @@ Cu.import("resource://gre/modules/XPCOMU
 Cu.import("resource://gre/modules/Services.jsm");
 
 function init_all() {
   document.documentElement.instantApply = true;
   window.history.replaceState("landing", document.title);
   window.addEventListener("popstate", onStatePopped, true);
   updateCommands();
   gMainPane.init();
-#ifdef XP_WIN
-  gTabsPane.init();
-#endif
   gPrivacyPane.init();
   gAdvancedPane.init();
   gApplicationsPane.init();
   gContentPane.init();
   gSyncPane.init();
   gSecurityPane.init();
   var initFinished = document.createEvent("Event");
   initFinished.initEvent("Initialized", true, true);
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -86,17 +86,16 @@
                    oncommand="cmd_forward()" tooltiptext="&buttonForward.tooltip;"
                    disabled="true"/>
   </hbox>
   
   <hbox class="main-content" flex="1">
     <prefpane flex="1" id="mainPrefPane">
 #include landing.xul
 #include main.xul
-#include tabs.xul
 #include privacy.xul
 #include advanced.xul
 #include applications.xul
 #include content.xul
 #include security.xul
 #ifdef MOZ_SERVICES_SYNC
 #include sync.xul
 #endif
deleted file mode 100644
--- a/browser/components/preferences/in-content/tabs.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var gTabsPane = {
-
-  /*
-   * Preferences:
-   *
-   * browser.link.open_newwindow
-   * - determines where pages which would open in a new window are opened:
-   *     1 opens such links in the most recent window or tab,
-   *     2 opens such links in a new window,
-   *     3 opens such links in a new tab
-   * browser.tabs.loadInBackground
-   * - true if display should switch to a new tab which has been opened from a
-   *   link, false if display shouldn't switch
-   * browser.tabs.warnOnClose
-   * - true if when closing a window with multiple tabs the user is warned and
-   *   allowed to cancel the action, false to just close the window
-   * browser.tabs.warnOnOpen
-   * - true if the user should be warned if he attempts to open a lot of tabs at
-   *   once (e.g. a large folder of bookmarks), false otherwise
-   * browser.taskbar.previews.enable
-   * - true if tabs are to be shown in the Windows 7 taskbar
-   */
-
-#ifdef XP_WIN
-  /**
-   * Initialize any platform-specific UI.
-   */
-  init: function () {
-    try {
-      let sysInfo = Cc["@mozilla.org/system-info;1"].
-                    getService(Ci.nsIPropertyBag2);
-      let ver = parseFloat(sysInfo.getProperty("version"));
-      let showTabsInTaskbar = document.getElementById("showTabsInTaskbar");
-      showTabsInTaskbar.hidden = ver < 6.1 || (ver >= 6.1 && history.state != "tabs");
-    } catch (ex) {}
-  },
-#endif
-
-  /**
-   * Determines where a link which opens a new window will open.
-   *
-   * @returns |true| if such links should be opened in new tabs
-   */
-  readLinkTarget: function() {
-    var openNewWindow = document.getElementById("browser.link.open_newwindow");
-    return openNewWindow.value != 2;
-  },
-
-  /**
-   * Determines where a link which opens a new window will open.
-   *
-   * @returns 2 if such links should be opened in new windows,
-   *          3 if such links should be opened in new tabs
-   */
-  writeLinkTarget: function() {
-    var linkTargeting = document.getElementById("linkTargeting");
-    return linkTargeting.checked ? 3 : 2;
-  }
-};
deleted file mode 100644
--- a/browser/components/preferences/in-content/tabs.xul
+++ /dev/null
@@ -1,76 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public License,
-   - v. 2.0. If a copy of the MPL was not distributed with this file,
-   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content/tabs.js"/>
-
-<preferences id="tabsPreferences">
-  <preference id="browser.link.open_newwindow"
-              name="browser.link.open_newwindow"
-              type="int"/>
-  <preference id="browser.tabs.loadInBackground"
-              name="browser.tabs.loadInBackground"
-              type="bool"
-              inverted="true"/>
-  <preference id="browser.tabs.warnOnClose"
-              name="browser.tabs.warnOnClose"
-              type="bool"/>
-  <preference id="browser.tabs.warnOnOpen"
-              name="browser.tabs.warnOnOpen"
-              type="bool"/>
-  <preference id="browser.sessionstore.restore_on_demand"
-              name="browser.sessionstore.restore_on_demand"
-              type="bool"/>
-#ifdef XP_WIN
-  <preference id="browser.taskbar.previews.enable"
-              name="browser.taskbar.previews.enable"
-              type="bool"/>
-#endif
-</preferences>
-
-<hbox class="heading" data-category="paneTabs" hidden="true">
-  <image class="preference-icon" type="tabs"/>
-  <html:h1>&paneTabs.title;</html:h1>
-</hbox>
-
-<checkbox id="linkTargeting" label="&newWindowsAsTabs.label;"
-          data-category="paneTabs" hidden="true"
-          accesskey="&newWindowsAsTabs.accesskey;"
-          preference="browser.link.open_newwindow"
-          onsyncfrompreference="return gTabsPane.readLinkTarget();"
-          onsynctopreference="return gTabsPane.writeLinkTarget();"
-          class="indent"/>
-
-<checkbox id="warnCloseMultiple" label="&warnCloseMultipleTabs.label;"
-          data-category="paneTabs" hidden="true"
-          accesskey="&warnCloseMultipleTabs.accesskey;"
-          preference="browser.tabs.warnOnClose"
-          class="indent"/>
-
-<checkbox id="warnOpenMany" label="&warnOpenManyTabs.label;"
-          data-category="paneTabs" hidden="true"
-          accesskey="&warnOpenManyTabs.accesskey;"
-          preference="browser.tabs.warnOnOpen"
-          class="indent"/>
-
-
-<checkbox id="restoreOnDemand" label="&restoreTabsOnDemand.label;"
-          data-category="paneTabs" hidden="true"
-          accesskey="&restoreTabsOnDemand.accesskey;"
-          preference="browser.sessionstore.restore_on_demand"
-          class="indent"/>
-
-<checkbox id="switchToNewTabs" label="&switchToNewTabs.label;"
-          data-category="paneTabs" hidden="true"
-          accesskey="&switchToNewTabs.accesskey;"
-          preference="browser.tabs.loadInBackground"
-          class="indent"/>
-
-#ifdef XP_WIN
-<checkbox id="showTabsInTaskbar" label="&showTabsInTaskbar.label;"
-          data-category="paneTabs" hidden="true"
-          accesskey="&showTabsInTaskbar.accesskey;"
-          preference="browser.taskbar.previews.enable"
-          class="indent"/>
-#endif
--- a/browser/locales/en-US/chrome/browser/preferences/tabs.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/tabs.dtd
@@ -14,8 +14,9 @@
 <!ENTITY restoreTabsOnDemand.label        "Don’t load tabs until selected">
 <!ENTITY restoreTabsOnDemand.accesskey    "l">
 
 <!ENTITY switchToNewTabs.label        "When I open a link in a new tab, switch to it immediately">
 <!ENTITY switchToNewTabs.accesskey    "s">
 
 <!ENTITY showTabsInTaskbar.label          "Show tab previews in the Windows taskbar">
 <!ENTITY showTabsInTaskbar.accesskey      "k">
+<!ENTITY tabsGroup.label          "Tabs">
--- a/browser/themes/linux/preferences/in-content/preferences.css
+++ b/browser/themes/linux/preferences/in-content/preferences.css
@@ -44,21 +44,16 @@
   margin: 0 20px;
 }
 
 .preference-icon[type="general"],
 .landingButton-icon[type="general"] {
   background-position: 0 0;
 }
 
-.preference-icon[type="tabs"],
-.landingButton-icon[type="tabs"] {
-  background-position: -32px 0;
-}
-
 .preference-icon[type="content"],
 .landingButton-icon[type="content"] {
   background-position: -64px 0;
 }
 
 .preference-icon[type="applications"],
 .landingButton-icon[type="applications"] {
   background-position: -96px 0;
--- a/browser/themes/osx/preferences/in-content/preferences.css
+++ b/browser/themes/osx/preferences/in-content/preferences.css
@@ -47,21 +47,16 @@
   margin: 0 20px;
 }
 
 .preference-icon[type="general"],
 .landingButton-icon[type="general"] {
   background-position: 0 0;
 }
 
-.preference-icon[type="tabs"],
-.landingButton-icon[type="tabs"] {
-  background-position: -32px 0;
-}
-
 .preference-icon[type="content"],
 .landingButton-icon[type="content"] {
   background-position: -64px 0;
 }
 
 .preference-icon[type="applications"],
 .landingButton-icon[type="applications"] {
   background-position: -96px 0;
--- a/browser/themes/windows/preferences/in-content/preferences.css
+++ b/browser/themes/windows/preferences/in-content/preferences.css
@@ -47,21 +47,16 @@
   margin: 0 20px;
 }
 
 .preference-icon[type="general"],
 .landingButton-icon[type="general"] {
   background-position: 0 0;
 }
 
-.preference-icon[type="tabs"],
-.landingButton-icon[type="tabs"] {
-  background-position: -32px 0;
-}
-
 .preference-icon[type="content"],
 .landingButton-icon[type="content"] {
   background-position: -64px 0;
 }
 
 .preference-icon[type="applications"],
 .landingButton-icon[type="applications"] {
   background-position: -96px 0;