OLD | NEW |
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/profile_resetter/brandcoded_default_settings.h" | 5 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" |
6 | 6 |
7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
10 #include "chrome/installer/util/master_preferences_constants.h" | 10 #include "chrome/installer/util/master_preferences_constants.h" |
| 11 #include "components/search_engines/search_engines_pref_names.h" |
11 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
12 | 13 |
13 BrandcodedDefaultSettings::BrandcodedDefaultSettings() { | 14 BrandcodedDefaultSettings::BrandcodedDefaultSettings() { |
14 } | 15 } |
15 | 16 |
16 BrandcodedDefaultSettings::BrandcodedDefaultSettings(const std::string& prefs) { | 17 BrandcodedDefaultSettings::BrandcodedDefaultSettings(const std::string& prefs) { |
17 if (!prefs.empty()) { | 18 if (!prefs.empty()) { |
18 JSONStringValueSerializer json(prefs); | 19 JSONStringValueSerializer json(prefs); |
19 std::string error; | 20 std::string error; |
20 scoped_ptr<base::Value> root(json.Deserialize(NULL, &error)); | 21 scoped_ptr<base::Value> root(json.Deserialize(NULL, &error)); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 scoped_ptr<base::ListValue> BrandcodedDefaultSettings::ExtractList( | 94 scoped_ptr<base::ListValue> BrandcodedDefaultSettings::ExtractList( |
94 const char* pref_name) const { | 95 const char* pref_name) const { |
95 const base::ListValue* value = NULL; | 96 const base::ListValue* value = NULL; |
96 if (master_dictionary_ && | 97 if (master_dictionary_ && |
97 master_dictionary_->GetList(pref_name, &value) && | 98 master_dictionary_->GetList(pref_name, &value) && |
98 !value->empty()) { | 99 !value->empty()) { |
99 return scoped_ptr<base::ListValue>(value->DeepCopy()); | 100 return scoped_ptr<base::ListValue>(value->DeepCopy()); |
100 } | 101 } |
101 return scoped_ptr<base::ListValue>(); | 102 return scoped_ptr<base::ListValue>(); |
102 } | 103 } |
OLD | NEW |