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