Bug 1436876 - Fix the value shown for the first suggestion in the search bar. r=florian draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Fri, 09 Feb 2018 15:21:49 +0000
changeset 753052 451c1120c992d8507ce5da136b7d56fc9579cdd1
parent 752970 d49553765a743ebbd4f08e92a93c9d811ee064c2
push id98469
push userpaolo.mozmail@amadzone.org
push dateFri, 09 Feb 2018 15:22:50 +0000
reviewersflorian
bugs1436876
milestone60.0a1
Bug 1436876 - Fix the value shown for the first suggestion in the search bar. r=florian MozReview-Commit-ID: 6UGjosi3ppX
toolkit/components/search/nsSearchSuggestions.js
toolkit/locales/en-US/chrome/search/search.properties
--- 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