Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(975)

Unified Diff: chrome/browser/policy/configuration_policy_handler.cc

Issue 11552020: Add search_terms_replacement_key field to TemplateURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed logic to check search_terms_replacement_key in template_url.cc. This is for a next CL. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d4c22bf3d7854ec7b3e022c4ca56afd78287527b..1beb2b4c04d7403c4ce7acdaaa8caae61e183821 100644
--- a/chrome/browser/policy/configuration_policy_handler.cc
+++ b/chrome/browser/policy/configuration_policy_handler.cc
@@ -90,6 +90,9 @@ const DefaultSearchSimplePolicyHandlerEntry kDefaultSearchPolicyMap[] = {
{ key::kDefaultSearchProviderAlternateURLs,
prefs::kDefaultSearchProviderAlternateURLs,
Value::TYPE_LIST },
+ { key::kDefaultSearchProviderSearchTermsReplacementKey,
+ prefs::kDefaultSearchProviderSearchTermsReplacementKey,
+ Value::TYPE_STRING },
};
// List of entries determining which proxy policies can be specified, depending
@@ -732,6 +735,8 @@ void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
prefs->SetString(prefs::kDefaultSearchProviderInstantURL, std::string());
prefs->SetValue(prefs::kDefaultSearchProviderAlternateURLs,
new ListValue());
+ prefs->SetString(prefs::kDefaultSearchProviderSearchTermsReplacementKey,
+ std::string());
} 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
@@ -749,6 +754,8 @@ void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
EnsureStringPrefExists(prefs, prefs::kDefaultSearchProviderKeyword);
EnsureStringPrefExists(prefs, prefs::kDefaultSearchProviderInstantURL);
EnsureListPrefExists(prefs, prefs::kDefaultSearchProviderAlternateURLs);
+ EnsureStringPrefExists(prefs,
+ prefs::kDefaultSearchProviderSearchTermsReplacementKey);
// 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

Powered by Google App Engine
This is Rietveld 408576698