Bug 1513532 - Add policies for search suggestions. r=Felipe,flod
authorMichael Kaply <mozilla@kaply.com>
Tue, 09 Apr 2019 20:16:53 +0000
changeset 468808 2e24668fe392b448a6a9f001bf9195cf29726498
parent 468807 9ad896485f8948c03866e0cbdd3ed48b878f5b2e
child 468809 9d3dbe3fef2671cf9cad2383415d412ddc6a2aa2
child 468833 a8c9a03ec27d8c0708fa2a7f29b4a6afe8304eee
push id35850
push userdvarga@mozilla.com
push dateWed, 10 Apr 2019 21:52:56 +0000
treeherdermozilla-central@9d3dbe3fef26 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, flod
bugs1513532
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1513532 - Add policies for search suggestions. r=Felipe,flod Differential Revision: https://phabricator.services.mozilla.com/D26752
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/schemas/policies-schema.json
browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
browser/locales/en-US/browser/policies/policies-descriptions.ftl
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -892,16 +892,22 @@ var Policies = {
               }
             }
           });
         }
       });
     },
   },
 
+  "SearchSuggestEnabled": {
+    onBeforeAddons(manager, param) {
+      setAndLockPref("browser.urlbar.suggest.searches", param);
+    },
+  },
+
   "SecurityDevices": {
     onProfileAfterChange(manager, param) {
       let securityDevices = param;
       let pkcs11db = Cc["@mozilla.org/security/pkcs11moduledb;1"].getService(Ci.nsIPKCS11ModuleDB);
       let moduleList = pkcs11db.listModules();
       for (let deviceName in securityDevices) {
         let foundModule = false;
         for (let module of moduleList) {
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -561,16 +561,25 @@
         "network.IDN_show_punycode": {
           "type": "boolean"
         },
         "browser.fixup.dns_first_for_single_words": {
           "type": "boolean"
         },
         "browser.cache.disk.parent_directory": {
           "type": "string"
+        },
+        "browser.urlbar.suggest.openpage": {
+          "type": "boolean"
+        },
+        "browser.urlbar.suggest.history": {
+          "type": "boolean"
+        },
+        "browser.urlbar.suggest.bookmark": {
+          "type": "boolean"
         }
       }
     },
 
     "Proxy": {
       "type": "object",
       "properties": {
         "Mode": {
@@ -691,16 +700,20 @@
           "type": "array",
           "items": {
             "type": "string"
           }
         }
       }
     },
 
+    "SearchSuggestEnabled": {
+      "type": "boolean"
+    },
+
     "SecurityDevices": {
       "type": "object",
       "patternProperties": {
         "^.*$": { "type": "string" }
       }
     },
 
     "SSLVersionMax": {
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
@@ -273,16 +273,26 @@ const POLICIES_TESTS = [
   {
     policies: {
       "NewTabPage": false,
     },
     lockedPrefs: {
       "browser.newtabpage.enabled": false,
     },
   },
+
+  // POLICY: SearchSuggestEnabled
+  {
+    policies: {
+      "SearchSuggestEnabled": false,
+    },
+    lockedPrefs: {
+      "browser.urlbar.suggest.searches": false,
+    },
+  },
 ];
 
 add_task(async function test_policy_remember_passwords() {
   for (let test of POLICIES_TESTS) {
     await setupPolicyEngineWithJson({
       "policies": test.policies,
     });
 
--- a/browser/locales/en-US/browser/policies/policies-descriptions.ftl
+++ b/browser/locales/en-US/browser/policies/policies-descriptions.ftl
@@ -120,16 +120,18 @@ policy-Proxy = Configure proxy settings.
 policy-RequestedLocales = Set the list of requested locales for the application in order of preference.
 
 policy-SanitizeOnShutdown = Clear all navigation data on shutdown.
 
 policy-SearchBar = Set the default location of the search bar. The user is still allowed to customize it.
 
 policy-SearchEngines = Configure search engine settings. This policy is only available on the Extended Support Release (ESR) version.
 
+policy-SearchSuggestEnabled = Enable or disable search suggestions.
+
 # For more information, see https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/PKCS11/Module_Installation
 policy-SecurityDevices = Install PKCS #11 modules.
 
 policy-SSLVersionMax = Set the maximum SSL version.
 
 policy-SSLVersionMin = Set the minimum SSL version.
 
 policy-SupportMenu = Add a custom support menu item to the help menu.