| Index: chrome/browser/policy/configuration_policy_handler.cc
|
| diff --git a/chrome/browser/policy/configuration_policy_handler.cc b/chrome/browser/policy/configuration_policy_handler.cc
|
| index cf8dfd3c16c63897e39b7fd85c3e6848bb7f65fa..709e2e0bf4112abd583ae3ce9d358cbb5416d131 100644
|
| --- a/chrome/browser/policy/configuration_policy_handler.cc
|
| +++ b/chrome/browser/policy/configuration_policy_handler.cc
|
| @@ -89,6 +89,9 @@ const DefaultSearchSimplePolicyHandlerEntry kDefaultSearchPolicyMap[] = {
|
| { key::kDefaultSearchProviderEncodings,
|
| prefs::kDefaultSearchProviderEncodings,
|
| Value::TYPE_LIST },
|
| + { key::kDefaultSearchProviderAlternateURLs,
|
| + prefs::kDefaultSearchProviderAlternateURLs,
|
| + Value::TYPE_LIST },
|
| };
|
|
|
| // List of entries determining which proxy policies can be specified, depending
|
| @@ -651,6 +654,8 @@ void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
|
| prefs->SetString(prefs::kDefaultSearchProviderEncodings, std::string());
|
| prefs->SetString(prefs::kDefaultSearchProviderKeyword, std::string());
|
| prefs->SetString(prefs::kDefaultSearchProviderInstantURL, std::string());
|
| + prefs->SetValue(prefs::kDefaultSearchProviderAlternateURLs,
|
| + new ListValue());
|
| } else {
|
| // The search URL is required. The other entries are optional. Just make
|
| // sure that they are all specified via policy, so that the regular prefs
|
| @@ -667,6 +672,7 @@ void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
|
| EnsureStringPrefExists(prefs, prefs::kDefaultSearchProviderEncodings);
|
| EnsureStringPrefExists(prefs, prefs::kDefaultSearchProviderKeyword);
|
| EnsureStringPrefExists(prefs, prefs::kDefaultSearchProviderInstantURL);
|
| + EnsureListPrefExists(prefs, prefs::kDefaultSearchProviderAlternateURLs);
|
|
|
| // For the name and keyword, default to the host if not specified. If
|
| // there is no host (file: URLs? Not sure), use "_" to guarantee that the
|
| @@ -753,6 +759,15 @@ void DefaultSearchPolicyHandler::EnsureStringPrefExists(
|
| prefs->SetString(path, value);
|
| }
|
|
|
| +void DefaultSearchPolicyHandler::EnsureListPrefExists(
|
| + PrefValueMap* prefs,
|
| + const std::string& path) {
|
| + base::Value* value;
|
| + base::ListValue* list_value;
|
| + if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value))
|
| + prefs->SetValue(path, new ListValue());
|
| +}
|
| +
|
|
|
| // ProxyPolicyHandler implementation -------------------------------------------
|
|
|
|
|