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

Side by Side Diff: chrome/browser/search_engines/default_search_policy_handler.cc

Issue 78763002: Move PolicyMap and its dependencies to components/policy/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export nested struct Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/search_engines/default_search_policy_handler.h" 5 #include "chrome/browser/search_engines/default_search_policy_handler.h"
6 6
7 #include "base/prefs/pref_value_map.h" 7 #include "base/prefs/pref_value_map.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
11 #include "chrome/browser/policy/policy_error_map.h" 11 #include "chrome/browser/policy/policy_error_map.h"
12 #include "chrome/browser/policy/policy_map.h"
13 #include "chrome/browser/search_engines/search_terms_data.h" 12 #include "chrome/browser/search_engines/search_terms_data.h"
14 #include "chrome/browser/search_engines/template_url.h" 13 #include "chrome/browser/search_engines/template_url.h"
15 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "components/policy/core/common/policy_map.h"
16 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
17 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
18 #include "policy/policy_constants.h" 18 #include "policy/policy_constants.h"
19 19
20 namespace policy { 20 namespace policy {
21 21
22 // List of policy types to preference names, for policies affecting the default 22 // List of policy types to preference names, for policies affecting the default
23 // search provider. 23 // search provider.
24 const PolicyToPreferenceMapEntry kDefaultSearchPolicyMap[] = { 24 const PolicyToPreferenceMapEntry kDefaultSearchPolicyMap[] = {
25 { key::kDefaultSearchProviderEnabled, 25 { key::kDefaultSearchProviderEnabled,
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 void DefaultSearchPolicyHandler::EnsureListPrefExists( 314 void DefaultSearchPolicyHandler::EnsureListPrefExists(
315 PrefValueMap* prefs, 315 PrefValueMap* prefs,
316 const std::string& path) { 316 const std::string& path) {
317 base::Value* value; 317 base::Value* value;
318 base::ListValue* list_value; 318 base::ListValue* list_value;
319 if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value)) 319 if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value))
320 prefs->SetValue(path, new ListValue()); 320 prefs->SetValue(path, new ListValue());
321 } 321 }
322 322
323 } // namespace policy 323 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698