Bug 1609699 - Rename browser.urlbar.searchTips pref to browser.urlbar.update1.searchTips. r?mak draft
authorHarry Twyford <htwyford@mozilla.com>
Thu, 16 Jan 2020 18:14:41 +0000
changeset 2598853 47703d4bfcb280611c098b8bb8573fc97effff1b
parent 2598325 7e0886a94d70b8696d6fc0481d9f9ae12b85c41a
child 2598854 1032846b33d7d615404cf75646b88b36db9df44a
push id476904
push userreviewbot
push dateThu, 16 Jan 2020 18:14:59 +0000
treeherdertry@1032846b33d7 [default view] [failures only]
reviewersmak
bugs1609699
milestone74.0a1
Bug 1609699 - Rename browser.urlbar.searchTips pref to browser.urlbar.update1.searchTips. r?mak Summary: Differential Revision: https://phabricator.services.mozilla.com/D60152 Test Plan: Reviewers: mak Subscribers: Bug #: 1609699 Differential Diff: PHID-DIFF-w5dq52e6rvm44t4pm6ur
browser/app/profile/firefox.js
browser/components/urlbar/UrlbarPrefs.jsm
browser/components/urlbar/UrlbarProviderSearchTips.jsm
browser/components/urlbar/tests/browser/browser_search_tips.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -300,20 +300,16 @@ pref("browser.urlbar.formatting.enabled"
 pref("browser.urlbar.trimURLs", true);
 
 pref("browser.urlbar.oneOffSearches", true);
 
 // If changed to true, copying the entire URL from the location bar will put the
 // human readable (percent-decoded) URL on the clipboard.
 pref("browser.urlbar.decodeURLsOnCopy", false);
 
-// If true, we show new users and those about to start an organic search a tip
-// encouraging them to use the Urlbar.
-pref("browser.urlbar.searchTips", false);
-
 // Whether or not to move tabs into the active window when using the "Switch to
 // Tab" feature of the awesomebar.
 pref("browser.urlbar.switchTabs.adoptIntoActiveWindow", false);
 
 // Whether addresses and search results typed into the address bar
 // should be opened in new tabs by default.
 pref("browser.urlbar.openintab", false);
 
@@ -331,16 +327,20 @@ pref("browser.urlbar.usepreloadedtopurls
   pref("browser.urlbar.update1", false);
   pref("browser.urlbar.update1.view.stripHttps", false);
   pref("browser.urlbar.openViewOnFocus", false);
 #endif
 // Whether we expand the font size when when the urlbar is
 // focused in design update 1.
 pref("browser.urlbar.update1.expandTextOnFocus", false);
 
+// If true, we show new users and those about to start an organic search a tip
+// encouraging them to use the Urlbar.
+pref("browser.urlbar.update1.searchTips", false);
+
 pref("browser.urlbar.eventTelemetry.enabled", false);
 
 pref("browser.altClickSave", false);
 
 // Enable logging downloads operations to the Console.
 pref("browser.download.loglevel", "Error");
 
 // Number of milliseconds to wait for the http headers (and thus
--- a/browser/components/urlbar/UrlbarPrefs.jsm
+++ b/browser/components/urlbar/UrlbarPrefs.jsm
@@ -113,20 +113,16 @@ const PREF_URLBAR_DEFAULTS = new Map([
   // Whether to open the urlbar view when the input field is focused by the user.
   ["openViewOnFocus", false],
 
   // When true, URLs in the user's history that look like search result pages
   // are styled to look like search engine results instead of the usual history
   // results.
   ["restyleSearches", false],
 
-  // If true, we show new users and those about to start an organic search a tip
-  // encouraging them to use the Urlbar.
-  ["searchTips", false],
-
   // The number of times the user has been shown a search tip.
   ["searchTips.shownCount", 0],
 
   // Whether speculative connections should be enabled.
   ["speculativeConnect.enabled", true],
 
   // Results will include the user's bookmarks when this is true.
   ["suggest.bookmark", true],
@@ -155,16 +151,20 @@ const PREF_URLBAR_DEFAULTS = new Map([
   ["usepreloadedtopurls.expire_days", 14],
 
   // Whether the quantum bar displays design update 1.
   ["update1", false],
 
   // If true, we strip https:// instead of http:// from URLs in the results view.
   ["update1.view.stripHttps", false],
 
+  // If true, we show new users and those about to start an organic search a tip
+  // encouraging them to use the Urlbar.
+  ["update1.searchTips", false],
+
   // Whether the urlbar displays a permanent search button in design update 2.
   ["update2.searchButton", false],
 ]);
 const PREF_OTHER_DEFAULTS = new Map([
   ["keyword.enabled", true],
   ["browser.search.suggest.enabled", true],
   ["browser.search.suggest.enabled.private", false],
   ["ui.popup.disable_autohide", false],
--- a/browser/components/urlbar/UrlbarProviderSearchTips.jsm
+++ b/browser/components/urlbar/UrlbarProviderSearchTips.jsm
@@ -113,17 +113,17 @@ class ProviderSearchTips extends UrlbarP
   /**
    * Whether this provider should be invoked for the given context.
    * If this method returns false, the providers manager won't start a query
    * with this provider, to save on resources.
    * @param {UrlbarQueryContext} queryContext The query context object
    * @returns {boolean} Whether this provider should be invoked for the search.
    */
   isActive(queryContext) {
-    return UrlbarPrefs.get("searchTips") && this.currentTip;
+    return UrlbarPrefs.get("update1.searchTips") && this.currentTip;
   }
 
   /**
    * Whether this provider wants to restrict results to just itself.
    * Other providers won't be invoked, unless this provider doesn't
    * support the current query.
    * @param {UrlbarQueryContext} queryContext The query context object
    * @returns {boolean} Whether this provider wants to restrict results.
--- a/browser/components/urlbar/tests/browser/browser_search_tips.js
+++ b/browser/components/urlbar/tests/browser/browser_search_tips.js
@@ -39,17 +39,17 @@ const GOOGLE_DOMAINS = [
 ];
 
 add_task(async function init() {
   await PlacesUtils.history.clear();
   await PlacesUtils.bookmarks.eraseEverything();
 
   await SpecialPowers.pushPrefEnv({
     set: [
-      ["browser.urlbar.searchTips", true],
+      ["browser.urlbar.update1.searchTips", true],
       ["browser.urlbar.searchTips.shownCount", 0],
       // We must disable our Top Sites behaviour for this test until we find a
       // way for multiple restricting providers to work together.
       // See bug 1607797.
       ["browser.urlbar.openViewOnFocus", false],
     ],
   });