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

Side by Side Diff: chrome/browser/policy/configuration_policy_handler.cc

Issue 9264070: Set prefs::kDefaultSearchProviderEnabled to false according to policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits Created 8 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_pref_store_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/policy/configuration_policy_handler.h" 5 #include "chrome/browser/policy/configuration_policy_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 errors->AddError(key::kDefaultSearchProviderSearchURL, 507 errors->AddError(key::kDefaultSearchProviderSearchURL,
508 IDS_POLICY_INVALID_SEARCH_URL_ERROR); 508 IDS_POLICY_INVALID_SEARCH_URL_ERROR);
509 return false; 509 return false;
510 } 510 }
511 return true; 511 return true;
512 } 512 }
513 513
514 void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, 514 void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
515 PrefValueMap* prefs) { 515 PrefValueMap* prefs) {
516 if (DefaultSearchProviderIsDisabled(policies)) { 516 if (DefaultSearchProviderIsDisabled(policies)) {
517 prefs->SetBoolean(prefs::kDefaultSearchProviderEnabled, false);
518
517 // If default search is disabled, the other fields are ignored. 519 // If default search is disabled, the other fields are ignored.
518 prefs->SetString(prefs::kDefaultSearchProviderName, std::string()); 520 prefs->SetString(prefs::kDefaultSearchProviderName, std::string());
519 prefs->SetString(prefs::kDefaultSearchProviderSearchURL, std::string()); 521 prefs->SetString(prefs::kDefaultSearchProviderSearchURL, std::string());
520 prefs->SetString(prefs::kDefaultSearchProviderSuggestURL, std::string()); 522 prefs->SetString(prefs::kDefaultSearchProviderSuggestURL, std::string());
521 prefs->SetString(prefs::kDefaultSearchProviderIconURL, std::string()); 523 prefs->SetString(prefs::kDefaultSearchProviderIconURL, std::string());
522 prefs->SetString(prefs::kDefaultSearchProviderEncodings, std::string()); 524 prefs->SetString(prefs::kDefaultSearchProviderEncodings, std::string());
523 prefs->SetString(prefs::kDefaultSearchProviderKeyword, std::string()); 525 prefs->SetString(prefs::kDefaultSearchProviderKeyword, std::string());
524 prefs->SetString(prefs::kDefaultSearchProviderInstantURL, std::string()); 526 prefs->SetString(prefs::kDefaultSearchProviderInstantURL, std::string());
525 return; 527 return;
526 } 528 }
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 } 963 }
962 } 964 }
963 965
964 if (setting != CONTENT_SETTING_DEFAULT) { 966 if (setting != CONTENT_SETTING_DEFAULT) {
965 prefs->SetValue(prefs::kManagedDefaultJavaScriptSetting, 967 prefs->SetValue(prefs::kManagedDefaultJavaScriptSetting,
966 Value::CreateIntegerValue(setting)); 968 Value::CreateIntegerValue(setting));
967 } 969 }
968 } 970 }
969 971
970 } // namespace policy 972 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698