diff options
12 files changed, 38 insertions, 0 deletions
diff --git a/chrome/app/policy/policy_templates.grd b/chrome/app/policy/policy_templates.grd index ab256d5..b665271 100644 --- a/chrome/app/policy/policy_templates.grd +++ b/chrome/app/policy/policy_templates.grd @@ -714,6 +714,12 @@ templates and will be translated for each locale. --> <message name="IDS_POLICY_DEFAULTSEARCHPROVIDERSUGGESTURL_DESC" desc="Caption of the 'Suggest URL' text field in the 'Default Search Provider' policy settings page."> Specifies the URL of the search engine used to provide search suggestions. The URL should contain the string '<ph name="SEARCH_TERM_MARKER">{searchTerms}</ph>', which will be replaced at query time by the text the user has entered so far. Optional. </message> + <message name="IDS_POLICY_DEFAULTSEARCHPROVIDERINSTANTURL_CAPTION" desc="The label of the 'Instant URL' text field in the 'Default Search Provider' policy settings page."> + Default search provider instant URL + </message> + <message name="IDS_POLICY_DEFAULTSEARCHPROVIDERINSTANTURL_DESC" desc="Caption of the 'Instant URL' text field in the 'Default Search Provider' policy settings page."> + Specifies the URL of the search engine used to provide instant results. The URL should contain the string '<ph name="SEARCH_TERM_MARKER">{searchTerms}</ph>', which will be replaced at query time by the text the user has entered so far. Optional. + </message> <message name="IDS_POLICY_DEFAULTSEARCHPROVIDERICONURL_CAPTION" desc="The label of the 'Icon URL' text field in the 'Default Search Provider' policy settings page."> Default search provider icon </message> diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json index e7a4463..274e00a 100644 --- a/chrome/app/policy/policy_templates.json +++ b/chrome/app/policy/policy_templates.json @@ -483,6 +483,15 @@ } }, { + 'name': 'DefaultSearchProviderInstantURL', + 'type': 'string', + 'supported_on': ['chrome.*:10-'], + 'annotations': { + 'features': {'dynamic_refresh': 1}, + 'example_value': 'http://search.my.company/suggest?q={searchTerms}', + } + }, + { 'name': 'DefaultSearchProviderIconURL', 'type': 'string', 'supported_on': ['chrome.*:8-'], diff --git a/chrome/browser/policy/config_dir_policy_provider_unittest.cc b/chrome/browser/policy/config_dir_policy_provider_unittest.cc index 8b7e9a0..982ac6fe 100644 --- a/chrome/browser/policy/config_dir_policy_provider_unittest.cc +++ b/chrome/browser/policy/config_dir_policy_provider_unittest.cc @@ -253,6 +253,9 @@ INSTANTIATE_TEST_CASE_P( kPolicyDefaultSearchProviderSuggestURL, key::kDefaultSearchProviderSuggestURL), ValueTestParams::ForStringPolicy( + kPolicyDefaultSearchProviderInstantURL, + key::kDefaultSearchProviderInstantURL), + ValueTestParams::ForStringPolicy( kPolicyDefaultSearchProviderIconURL, key::kDefaultSearchProviderIconURL), ValueTestParams::ForStringPolicy( diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc index 1f6355a..1330279 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.cc +++ b/chrome/browser/policy/configuration_policy_pref_store.cc @@ -443,6 +443,7 @@ void ConfigurationPolicyPrefKeeper::FinalizeDefaultSearchPolicySettings() { prefs_.SetString(prefs::kDefaultSearchProviderIconURL, std::string()); prefs_.SetString(prefs::kDefaultSearchProviderEncodings, std::string()); prefs_.SetString(prefs::kDefaultSearchProviderKeyword, std::string()); + prefs_.SetString(prefs::kDefaultSearchProviderInstantURL, std::string()); return; } std::string search_url; @@ -459,6 +460,7 @@ void ConfigurationPolicyPrefKeeper::FinalizeDefaultSearchPolicySettings() { EnsureStringPrefExists(prefs::kDefaultSearchProviderIconURL); EnsureStringPrefExists(prefs::kDefaultSearchProviderEncodings); EnsureStringPrefExists(prefs::kDefaultSearchProviderKeyword); + EnsureStringPrefExists(prefs::kDefaultSearchProviderInstantURL); // For the name, default to the host if not specified. std::string name; @@ -702,6 +704,8 @@ ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList() { key::kDefaultSearchProviderSearchURL }, { kPolicyDefaultSearchProviderSuggestURL, Value::TYPE_STRING, key::kDefaultSearchProviderSuggestURL }, + { kPolicyDefaultSearchProviderInstantURL, Value::TYPE_STRING, + key::kDefaultSearchProviderInstantURL }, { kPolicyDefaultSearchProviderIconURL, Value::TYPE_STRING, key::kDefaultSearchProviderIconURL }, { kPolicyDefaultSearchProviderEncodings, Value::TYPE_STRING, diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc index 42bfaaa..9f461c1 100644 --- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc +++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc @@ -393,6 +393,10 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, MinimallyDefined) { EXPECT_EQ(PrefStore::READ_OK, store.GetValue(prefs::kDefaultSearchProviderEncodings, &value)); EXPECT_TRUE(StringValue(std::string()).Equals(value)); + + EXPECT_EQ(PrefStore::READ_OK, + store.GetValue(prefs::kDefaultSearchProviderInstantURL, &value)); + EXPECT_TRUE(StringValue(std::string()).Equals(value)); } // Checks that for a fully defined search policy, all elements have been diff --git a/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc b/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc index 345a3f6..4203fb0 100644 --- a/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc +++ b/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc @@ -227,6 +227,9 @@ INSTANTIATE_TEST_CASE_P( kPolicyDefaultSearchProviderSuggestURL, key::kDefaultSearchProviderSuggestURL), PolicyTestParams::ForStringPolicy( + kPolicyDefaultSearchProviderInstantURL, + key::kDefaultSearchProviderInstantURL), + PolicyTestParams::ForStringPolicy( kPolicyDefaultSearchProviderIconURL, key::kDefaultSearchProviderIconURL), PolicyTestParams::ForStringPolicy( diff --git a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc index beed450..6085192 100644 --- a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc +++ b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc @@ -385,6 +385,9 @@ INSTANTIATE_TEST_CASE_P( kPolicyDefaultSearchProviderSuggestURL, key::kDefaultSearchProviderSuggestURL), PolicyTestParams::ForStringPolicy( + kPolicyDefaultSearchProviderInstantURL, + key::kDefaultSearchProviderInstantURL), + PolicyTestParams::ForStringPolicy( kPolicyDefaultSearchProviderIconURL, key::kDefaultSearchProviderIconURL), PolicyTestParams::ForStringPolicy( diff --git a/chrome/browser/policy/configuration_policy_store_interface.h b/chrome/browser/policy/configuration_policy_store_interface.h index b6d1f3b..e690242 100644 --- a/chrome/browser/policy/configuration_policy_store_interface.h +++ b/chrome/browser/policy/configuration_policy_store_interface.h @@ -23,6 +23,7 @@ enum ConfigurationPolicyType { kPolicyDefaultSearchProviderSearchURL, kPolicyDefaultSearchProviderSuggestURL, kPolicyDefaultSearchProviderIconURL, + kPolicyDefaultSearchProviderInstantURL, kPolicyDefaultSearchProviderEncodings, kPolicyDisableSpdy, kPolicyProxyMode, diff --git a/chrome/browser/policy/managed_prefs_banner_base.cc b/chrome/browser/policy/managed_prefs_banner_base.cc index 7c20a09..826f453 100644 --- a/chrome/browser/policy/managed_prefs_banner_base.cc +++ b/chrome/browser/policy/managed_prefs_banner_base.cc @@ -62,6 +62,7 @@ void ManagedPrefsBannerBase::Init(PrefService* local_state, AddUserPref(prefs::kDefaultSearchProviderEnabled); AddUserPref(prefs::kDefaultSearchProviderName); AddUserPref(prefs::kDefaultSearchProviderKeyword); + AddUserPref(prefs::kDefaultSearchProviderInstantURL); AddUserPref(prefs::kDefaultSearchProviderSearchURL); AddUserPref(prefs::kDefaultSearchProviderSuggestURL); AddUserPref(prefs::kDefaultSearchProviderIconURL); diff --git a/chrome/browser/prefs/pref_set_observer.cc b/chrome/browser/prefs/pref_set_observer.cc index 133b219..499aa52 100644 --- a/chrome/browser/prefs/pref_set_observer.cc +++ b/chrome/browser/prefs/pref_set_observer.cc @@ -66,6 +66,7 @@ PrefSetObserver* PrefSetObserver::CreateDefaultSearchPrefSetObserver( pref_set->AddPref(prefs::kDefaultSearchProviderSearchURL); pref_set->AddPref(prefs::kDefaultSearchProviderSuggestURL); pref_set->AddPref(prefs::kDefaultSearchProviderIconURL); + pref_set->AddPref(prefs::kDefaultSearchProviderInstantURL); pref_set->AddPref(prefs::kDefaultSearchProviderEncodings); return pref_set; diff --git a/chrome/common/policy_constants.cc b/chrome/common/policy_constants.cc index 8ed8934..848b28b 100644 --- a/chrome/common/policy_constants.cc +++ b/chrome/common/policy_constants.cc @@ -27,6 +27,8 @@ const char kDefaultSearchProviderSearchURL[] = "DefaultSearchProviderSearchURL"; const char kDefaultSearchProviderSuggestURL[] = "DefaultSearchProviderSuggestURL"; +const char kDefaultSearchProviderInstantURL[] = + "DefaultSearchProviderInstantURL"; const char kDefaultSearchProviderIconURL[] = "DefaultSearchProviderIconURL"; const char kDefaultSearchProviderEncodings[] = diff --git a/chrome/common/policy_constants.h b/chrome/common/policy_constants.h index 279197e..37464e6 100644 --- a/chrome/common/policy_constants.h +++ b/chrome/common/policy_constants.h @@ -27,6 +27,7 @@ extern const char kDefaultSearchProviderName[]; extern const char kDefaultSearchProviderKeyword[]; extern const char kDefaultSearchProviderSearchURL[]; extern const char kDefaultSearchProviderSuggestURL[]; +extern const char kDefaultSearchProviderInstantURL[]; extern const char kDefaultSearchProviderIconURL[]; extern const char kDefaultSearchProviderEncodings[]; extern const char kDisableSpdy[]; |