From d34e2f8277e2fd547dd4c9d6321b4dac9ba576ad Mon Sep 17 00:00:00 2001 From: Blake Winton Date: Fri, 31 Oct 2014 16:00:34 -0400 Subject: [PATCH] Bug 1026568 - Add placeholder text to the newtab page. r=adw, ui-r=clarkbw --- browser/base/content/newtab/search.js | 3 +-- browser/modules/ContentSearch.jsm | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/browser/base/content/newtab/search.js b/browser/base/content/newtab/search.js index 643bbc52cea6..ae676d29307c 100644 --- a/browser/base/content/newtab/search.js +++ b/browser/base/content/newtab/search.js @@ -213,12 +213,11 @@ let gSearch = { if (uri) { this._nodes.logo.style.backgroundImage = "url(" + uri + ")"; - this._nodes.text.placeholder = ""; } else { this._nodes.logo.style.backgroundImage = ""; - this._nodes.text.placeholder = engine.name; } + this._nodes.text.placeholder = engine.placeholder; // Set up the suggestion controller. if (!this._suggestionController) { diff --git a/browser/modules/ContentSearch.jsm b/browser/modules/ContentSearch.jsm index eff26221ed78..56fec5263db6 100644 --- a/browser/modules/ContentSearch.jsm +++ b/browser/modules/ContentSearch.jsm @@ -96,6 +96,7 @@ this.ContentSearch = { addMessageListener(INBOUND_MESSAGE, this); Services.obs.addObserver(this, "browser-search-engine-modified", false); Services.obs.addObserver(this, "shutdown-leaks-before-check", false); + this._stringBundle = Services.strings.createBundle("chrome://global/locale/autocomplete.properties"); }, destroy: function () { @@ -391,8 +392,11 @@ this.ContentSearch = { let favicon = engine.getIconURLBySize(16, 16); let uri1x = engine.getIconURLBySize(65, 26); let uri2x = engine.getIconURLBySize(130, 52); + let placeholder = this._stringBundle.formatStringFromName( + "searchWithEngine", [engine.name], 1); let obj = { name: engine.name, + placeholder: placeholder, iconBuffer: yield this._arrayBufferFromDataURI(favicon), logoBuffer: yield this._arrayBufferFromDataURI(uri1x), logo2xBuffer: yield this._arrayBufferFromDataURI(uri2x),