Bug 461184 - Change urlbar placeholder text to 'Go to a Web Site'. r=mano
authorDão Gottwald <dao@mozilla.com>
Sat, 05 Jun 2010 18:47:19 +0200
changeset 43124 ea4e623e936d7a1c03df8967b3bd8d99c5286893
parent 43123 b219912edfec87b80b97b44b6831868c7b1dcf31
child 43125 b5b016bb7c91740a438ecc24d1cbc41fb61a9302
push id13628
push userdgottwald@mozilla.com
push dateSat, 05 Jun 2010 16:48:10 +0000
treeherdermozilla-central@ea4e623e936d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmano
bugs461184
milestone1.9.3a5pre
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 461184 - Change urlbar placeholder text to 'Go to a Web Site'. r=mano
browser/base/content/browser.xul
browser/base/content/urlbarBindings.xml
browser/components/preferences/tests/browser_privacypane_1.js
browser/components/preferences/tests/privacypane_tests.js
browser/locales/en-US/chrome/browser/browser.dtd
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -462,20 +462,17 @@
                      ondragenter="homeButtonObserver.onDragOver(event)"
                      ondrop="homeButtonObserver.onDrop(event)"
                      ondragleave="homeButtonObserver.onDragLeave(event)"
                      onclick="BrowserGoHome(event);"/>
 
       <toolbaritem id="urlbar-container" align="center" flex="400" persist="width"
                    title="&locationItem.title;" class="chromeclass-location" removable="true">
         <textbox id="urlbar" flex="1"
-                 bookmarkhistoryplaceholder="&urlbar.bookmarkhistory.emptyText;"
-                 bookmarkplaceholder="&urlbar.bookmark.emptyText;"
-                 historyplaceholder="&urlbar.history.emptyText;"
-                 noneplaceholder="&urlbar.none.emptyText;"
+                 placeholder="&urlbar.placeholder;"
                  type="autocomplete"
                  autocompletesearch="history"
                  autocompletesearchparam="enable-actions"
                  autocompletepopup="PopupAutoCompleteRichResult"
                  completeselectedindex="true"
                  tabscrolling="true"
                  showcommentcolumn="true"
                  showimagecolumn="true"
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -48,17 +48,16 @@
                                 .getBranch("browser.urlbar.")
                                 .QueryInterface(Components.interfaces.nsIPrefBranch2);
 
         this._prefs.addObserver("", this, false);
         this.clickSelectsAll = this._prefs.getBoolPref("clickSelectsAll");
         this.doubleClickSelectsAll = this._prefs.getBoolPref("doubleClickSelectsAll");
         this.completeDefaultIndex = this._prefs.getBoolPref("autoFill");
         this.timeout = this._prefs.getIntPref("delay");
-        this._setPlaceholder();
 
         this._urlTooltip = document.getElementById("urlTooltip");
 
         this.inputField.controllers.insertControllerAt(0, this._copyCutController);
         this.inputField.addEventListener("mousedown", this, false);
         this.inputField.addEventListener("mousemove", this, false);
         this.inputField.addEventListener("mouseout", this, false);
         this.inputField.addEventListener("overflow", this, false);
@@ -402,20 +401,16 @@
                 this[aData] = this._prefs.getBoolPref(aData);
                 break;
               case "autoFill":
                 this.completeDefaultIndex = this._prefs.getBoolPref(aData);
                 break;
               case "delay":
                 this.timeout = this._prefs.getIntPref(aData);
                 break;
-              case "autocomplete.enabled":
-              case "default.behavior":
-                this._setPlaceholder();
-                break;
             }
           }
         ]]></body>
       </method>
 
       <method name="handleEvent">
         <parameter name="aEvent"/>
         <body><![CDATA[
@@ -461,37 +456,16 @@
           this.dispatchEvent(evt);
           this.mIgnoreInput = false;
 
           return this.value;
           ]]>
         </setter>
       </property>
 
-      <method name="_setPlaceholder">
-        <body><![CDATA[
-          var type = "none";
-          if (this._prefs.getBoolPref("autocomplete.enabled")) {
-            // Bottom 2 bits of default.behavior specify history/bookmark
-            switch (this._prefs.getIntPref("default.behavior") & 3) {
-              case 0:
-                type = "bookmarkhistory";
-                break;
-              case 1:
-                type = "history";
-                break;
-              case 2:
-                type = "bookmark";
-                break;
-            }
-          }
-          this.placeholder = this.getAttribute(type + "placeholder");
-        ]]></body>
-      </method>
-
       <method name="_parseActionUrl">
         <parameter name="aUrl"/>
         <body><![CDATA[
           if (!/^moz-action:/.test(aUrl))
             return null;
 
           // url is in the format moz-action:ACTION,PARAM
           let [, action, param] = aUrl.match(/^moz-action:([^,]+),(.*)$/);
--- a/browser/components/preferences/tests/browser_privacypane_1.js
+++ b/browser/components/preferences/tests/browser_privacypane_1.js
@@ -36,17 +36,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
                getService(Ci.mozIJSSubScriptLoader);
   loader.loadSubScript("chrome://mochikit/content/browser/browser/components/preferences/tests/privacypane_tests.js", this);
 
   run_test_subset([
-    test_locbar_placeholder,
     test_pane_visibility,
     test_dependent_elements,
     test_dependent_cookie_elements,
     test_dependent_clearonclose_elements,
     test_dependent_prefs,
 
     // reset all preferences to their default values once we're done
     reset_preferences
--- a/browser/components/preferences/tests/privacypane_tests.js
+++ b/browser/components/preferences/tests/privacypane_tests.js
@@ -60,30 +60,16 @@ function runTestOnPrivacyPrefPane(testFu
   let dialog = openDialog("chrome://browser/content/preferences/preferences.xul", "Preferences",
                           "chrome,titlebar,toolbar,centerscreen,dialog=no", "panePrivacy");
 }
 
 function controlChanged(element) {
   element.doCommand();
 }
 
-function test_locbar_placeholder(win) {
-  let texts = ["none", "bookmarkhistory", "history", "bookmark"];
-
-  let locbarlist = win.document.getElementById("locationBarSuggestion");
-  ok(locbarlist, "location bar suggestion menulist should exist");
-
-  for (let level = -1; level <= 2; ++level) {
-    locbarlist.value = level;
-    controlChanged(locbarlist);
-    is(gURLBar.placeholder, gURLBar.getAttribute(texts[level + 1] + "placeholder"),
-       "location bar placeholder for for level " + level + " is correctly set");
-  }
-}
-
 function test_pane_visibility(win) {
   let modes = {
     "remember": "historyRememberPane",
     "dontremember": "historyDontRememberPane",
     "custom": "historyCustomPane"
   };
 
   let historymode = win.document.getElementById("historyMode");
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -224,20 +224,17 @@
 <!-- LOCALIZATION NOTE (historyUndoWindowMenu): see bug 394759 -->
 <!ENTITY historyUndoWindowMenu.label "Recently Closed Windows">
 
 <!ENTITY historyHomeCmd.label "Home">
 <!ENTITY showAllHistoryCmd2.label "Show All History">
 <!ENTITY showAllHistoryCmd.commandkey "H">
 
 <!ENTITY openCmd.commandkey           "l">
-<!ENTITY urlbar.bookmarkhistory.emptyText "Search Bookmarks and History">
-<!ENTITY urlbar.bookmark.emptyText    "Search Bookmarks">
-<!ENTITY urlbar.history.emptyText     "Search History">
-<!ENTITY urlbar.none.emptyText        "Type a Web address">
+<!ENTITY urlbar.placeholder           "Go to a Web Site">
 <!ENTITY urlbar.accesskey             "d">
 <!ENTITY urlbar.switchToTab.label     "Switch to tab:">
 
 <!-- 
   Comment duplicated from browser-sets.inc:
 
   Search Command Key Logic works like this: