Merge f-t to m-c, a=merge
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 28 Dec 2014 10:48:47 -0800
changeset 238167 6d5a1e68f248f3e3cb54234096bd1f535dda25bd
parent 238165 4b23d490f1b2f4c6d4a296ad08521c741310fc7d (current diff)
parent 238166 efe3dcc7a74545f7dfd5631fa5825208c0652ccc (diff)
child 238168 8850aa0f5332d3727c063669819e02dac4c5c959
child 238185 584dde4b0fbfc1f41627c9c00974b07f27579fae
child 238190 163080209ca97b609de6b7246d44078e21627915
child 238195 0fa01129897c08a41664c95e550788d99f7723ee
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone37.0a1
Merge f-t to m-c, a=merge
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -1,15 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
 /* 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/. */
 
 const nsICookie = Components.interfaces.nsICookie;
 
+Components.utils.import("resource://gre/modules/PluralForm.jsm");
+
 var gCookiesWindow = {
   _cm               : Components.classes["@mozilla.org/cookiemanager;1"]
                                 .getService(Components.interfaces.nsICookieManager),
   _ds               : Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
                                 .getService(Components.interfaces.nsIScriptableDateFormat),
   _hosts            : {},
   _hostOrder        : [],
   _tree             : null,
@@ -546,22 +548,21 @@ var gCookiesWindow = {
         else if (!item.container)
           ++selectedCookieCount;
       }
     }
     var item = this._view._getItemAtIndex(seln.currentIndex);
     if (item && seln.count == 1 && item.container && item.open)
       selectedCookieCount += 2;
 
-    var removeCookie = document.getElementById("removeCookie");
-    var removeCookies = document.getElementById("removeCookies");
-    removeCookie.parentNode.selectedPanel =
-      selectedCookieCount == 1 ? removeCookie : removeCookies;
+    let buttonLabel = this._bundle.getString("removeSelectedCookies");
+    let removeSelectedCookies = document.getElementById("removeSelectedCookies");
+    removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel);
 
-    removeCookie.disabled = removeCookies.disabled = !(seln.count > 0);
+    removeSelectedCookies.disabled = !(seln.count > 0);
   },
 
   performDeletion: function gCookiesWindow_performDeletion(deleteItems) {
     var psvc = Components.classes["@mozilla.org/preferences-service;1"]
                          .getService(Components.interfaces.nsIPrefBranch);
     var blockFutureCookies = false;
     if (psvc.prefHasUserValue("network.cookie.blockFutureCookies"))
       blockFutureCookies = psvc.getBoolPref("network.cookie.blockFutureCookies");
--- a/browser/components/preferences/cookies.xul
+++ b/browser/components/preferences/cookies.xul
@@ -87,26 +87,21 @@
             <textbox id="expires" readonly="true" class="plain"/>
           </row>
         </rows>
       </grid>
     </hbox>
   </vbox>
   <hbox align="end">
     <hbox class="actionButtons" flex="1">
-      <deck oncommand="gCookiesWindow.deleteCookie();">
-        <button id="removeCookie" disabled="true" icon="remove"
-                label="&button.removecookie.label;"
-                accesskey="&button.removecookie.accesskey;"/>
-        <button id="removeCookies" disabled="true" icon="remove"
-                label="&button.removecookies.label;"
-                accesskey="&button.removecookie.accesskey;"/>
-      </deck>
+      <button id="removeSelectedCookies" disabled="true" icon="clear"
+              accesskey="&button.removeSelectedCookies.accesskey;"
+              oncommand="gCookiesWindow.deleteCookie();"/>
       <button id="removeAllCookies" disabled="true" icon="clear"
-              label="&button.removeallcookies.label;" accesskey="&button.removeallcookies.accesskey;"
+              label="&button.removeAllCookies.label;" accesskey="&button.removeAllCookies.accesskey;"
               oncommand="gCookiesWindow.deleteAllCookies();"/>
       <spacer flex="1"/>
 #ifndef XP_MACOSX
       <button oncommand="close();" icon="close"
               label="&button.close.label;" accesskey="&button.close.accesskey;"/>
 #endif
     </hbox>
   </hbox>
--- a/browser/components/preferences/tests/browser_bug705422.js
+++ b/browser/components/preferences/tests/browser_bug705422.js
@@ -76,27 +76,26 @@ function runTest(win, searchTerm, cookie
     is(win.gCookiesWindow._view.rowCount, matches, "Correct number of cookies shown after filter is applied");
 
     // "delete all cookies" should be enabled
     isDisabled(win, false);
 
 
     // select first cookie and delete
     var tree = win.document.getElementById("cookiesList");
-    var deleteButton = win.document.getElementById("removeCookie");
+    var deleteButton = win.document.getElementById("removeSelectedCookies");
     var rect = tree.treeBoxObject.getCoordsForCellItem(0, tree.columns[0], "cell");
     EventUtils.synthesizeMouse(tree.body, rect.x + rect.width / 2, rect.y + rect.height / 2, {}, win);
     EventUtils.synthesizeMouseAtCenter(deleteButton, {}, win);
 
     // count cookies should be matches-1
     is(win.gCookiesWindow._view.rowCount, matches-1, "Deleted selected cookie");
 
     // select two adjacent cells and delete
     EventUtils.synthesizeMouse(tree.body, rect.x + rect.width / 2, rect.y + rect.height / 2, {}, win);
-    deleteButton = win.document.getElementById("removeCookies"); 
     var eventObj = {};
     if (navigator.platform.indexOf("Mac") >= 0)
         eventObj.metaKey = true;
     else
         eventObj.ctrlKey = true;
     rect = tree.treeBoxObject.getCoordsForCellItem(1, tree.columns[0], "cell");
     EventUtils.synthesizeMouse(tree.body, rect.x + rect.width / 2, rect.y + rect.height / 2, eventObj, win);
     EventUtils.synthesizeMouseAtCenter(deleteButton, {}, win);
--- a/browser/locales/en-US/chrome/browser/preferences/cookies.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/cookies.dtd
@@ -2,21 +2,19 @@
    - 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/. -->
 
 <!ENTITY window.width                       "36em">
 
 <!ENTITY     cookiesonsystem.label          "The following cookies are stored on your computer:">
 <!ENTITY     cookiename.label               "Cookie Name">
 <!ENTITY     cookiedomain.label             "Site"> 
-<!ENTITY     button.removecookies.label     "Remove Cookies">
-<!ENTITY     button.removecookie.label      "Remove Cookie">
-<!ENTITY     button.removecookie.accesskey  "R">
-<!ENTITY     button.removeallcookies.label  "Remove All Cookies">
-<!ENTITY     button.removeallcookies.accesskey "A">
+<!ENTITY     button.removeSelectedCookies.accesskey "R">
+<!ENTITY     button.removeAllCookies.label "Remove All">
+<!ENTITY     button.removeAllCookies.accesskey "A">
 
 <!ENTITY     props.name.label               "Name:">
 <!ENTITY     props.value.label              "Content:">
 <!ENTITY     props.domain.label             "Host:">
 <!ENTITY     props.path.label               "Path:">
 <!ENTITY     props.secure.label             "Send For:">
 <!ENTITY     props.expires.label            "Expires:">
 
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -87,16 +87,20 @@ forAnyConnection=Any type of connection
 expireAtEndOfSession=At end of session
 can=Allow
 canAccessFirstParty=Allow first party only
 canSession=Allow for Session
 cannot=Block
 noCookieSelected=<no cookie selected>
 cookiesAll=The following cookies are stored on your computer:
 cookiesFiltered=The following cookies match your search:
+# LOCALIZATION NOTE (removeSelectedCookies):
+# Semicolon-separated list of plural forms. See:
+# http://developer.mozilla.org/en/docs/Localization_and_Plurals
+removeSelectedCookies=Remove Selected;Remove Selected
 
 #### Offline apps
 offlineAppsList.height=7em
 offlineAppRemoveTitle=Remove offline website data
 offlineAppRemovePrompt=After removing this data, %S will not be available offline.  Are you sure you want to remove this offline website?
 offlineAppRemoveConfirm=Remove offline data
 
 # LOCALIZATION NOTE: The next string is for the disk usage of the