Bug 1026568 - Add placeholder text to the newtab page. r=adw, ui-r=clarkbw

This commit is contained in:
Blake Winton 2014-10-31 16:00:34 -04:00
parent a877c17c2c
commit 03e13c3287
2 changed files with 5 additions and 2 deletions

View File

@ -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) {

View File

@ -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),