Bug 1436876 - Fix the value shown for the first suggestion in the search bar. r=florian
MozReview-Commit-ID: 6UGjosi3ppX
--- a/toolkit/components/search/nsSearchSuggestions.js
+++ b/toolkit/components/search/nsSearchSuggestions.js
@@ -21,23 +21,16 @@ function SuggestAutoComplete() {
}
SuggestAutoComplete.prototype = {
_init() {
this._suggestionController = new SearchSuggestionController(obj => this.onResultsReturned(obj));
this._suggestionController.maxLocalResults = this._historyLimit;
},
- get _suggestionLabel() {
- let bundle = Services.strings.createBundle("chrome://global/locale/search/search.properties");
- let label = bundle.GetStringFromName("suggestion_label");
- Object.defineProperty(SuggestAutoComplete.prototype, "_suggestionLabel", {value: label});
- return label;
- },
-
/**
* The object implementing nsIAutoCompleteObserver that we notify when
* we have found results
* @private
*/
_listener: null,
/**
@@ -59,19 +52,18 @@ SuggestAutoComplete.prototype = {
// If form history has results, add them to the list.
for (let i = 0; i < results.local.length; ++i) {
finalResults.push(results.local[i]);
finalComments.push("");
}
// If there are remote matches, add them.
if (results.remote.length) {
- // "comments" column values for suggestions starts as empty strings
- let comments = new Array(results.remote.length).fill("", 1);
- comments[0] = this._suggestionLabel;
+ // "comments" column values for suggestions are empty strings
+ let comments = new Array(results.remote.length).fill("");
// now put the history results above the suggestions
finalResults = finalResults.concat(results.remote);
finalComments = finalComments.concat(comments);
}
// Notify the FE of our new results
this.onResultsReady(results.term, finalResults, finalComments, results.formHistoryResult);
},
--- a/toolkit/locales/en-US/chrome/search/search.properties
+++ b/toolkit/locales/en-US/chrome/search/search.properties
@@ -11,10 +11,8 @@ error_loading_engine_title=Download Erro
# LOCALIZATION NOTE (error_loading_engine_msg2): %1$S = brandShortName, %2$S = location
error_loading_engine_msg2=%S could not download the search plugin from:\n%S
error_duplicate_engine_msg=%S could not install the search plugin from ā%Sā because an engine with the same name already exists.
error_invalid_engine_title=Install Error
error_invalid_format_title=Invalid Format
# LOCALIZATION NOTE (error_invalid_engine_msg2): %1$S = brandShortName, %2$S = location (url)
error_invalid_engine_msg2=%1$S could not install the search engine from: %2$S
-
-suggestion_label=Suggestions