OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/search_engines/default_search_policy_handler.h" | 5 #include "components/search_engines/default_search_policy_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/prefs/pref_value_map.h" | |
12 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
13 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
15 #include "components/policy/core/browser/policy_error_map.h" | 14 #include "components/policy/core/browser/policy_error_map.h" |
16 #include "components/policy/core/common/policy_map.h" | 15 #include "components/policy/core/common/policy_map.h" |
| 16 #include "components/prefs/pref_value_map.h" |
17 #include "components/search_engines/default_search_manager.h" | 17 #include "components/search_engines/default_search_manager.h" |
18 #include "components/search_engines/search_engines_pref_names.h" | 18 #include "components/search_engines/search_engines_pref_names.h" |
19 #include "components/search_engines/search_terms_data.h" | 19 #include "components/search_engines/search_terms_data.h" |
20 #include "components/search_engines/template_url.h" | 20 #include "components/search_engines/template_url.h" |
21 #include "grit/components_strings.h" | 21 #include "grit/components_strings.h" |
22 #include "policy/policy_constants.h" | 22 #include "policy/policy_constants.h" |
23 | 23 |
24 namespace policy { | 24 namespace policy { |
25 | 25 |
26 namespace { | 26 namespace { |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 void DefaultSearchPolicyHandler::EnsureListPrefExists( | 364 void DefaultSearchPolicyHandler::EnsureListPrefExists( |
365 PrefValueMap* prefs, | 365 PrefValueMap* prefs, |
366 const std::string& path) { | 366 const std::string& path) { |
367 base::Value* value; | 367 base::Value* value; |
368 base::ListValue* list_value; | 368 base::ListValue* list_value; |
369 if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value)) | 369 if (!prefs->GetValue(path, &value) || !value->GetAsList(&list_value)) |
370 prefs->SetValue(path, make_scoped_ptr(new base::ListValue())); | 370 prefs->SetValue(path, make_scoped_ptr(new base::ListValue())); |
371 } | 371 } |
372 | 372 |
373 } // namespace policy | 373 } // namespace policy |
OLD | NEW |