| 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 "extensions/browser/extension_prefs.h" | 5 #include "extensions/browser/extension_prefs.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_notifier.h" | 10 #include "base/prefs/pref_notifier.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 public: | 202 public: |
| 203 ScopedExtensionPrefUpdate(PrefService* service, | 203 ScopedExtensionPrefUpdate(PrefService* service, |
| 204 const std::string& extension_id) : | 204 const std::string& extension_id) : |
| 205 DictionaryPrefUpdate(service, pref_names::kExtensions), | 205 DictionaryPrefUpdate(service, pref_names::kExtensions), |
| 206 extension_id_(extension_id) {} | 206 extension_id_(extension_id) {} |
| 207 | 207 |
| 208 virtual ~ScopedExtensionPrefUpdate() { | 208 virtual ~ScopedExtensionPrefUpdate() { |
| 209 } | 209 } |
| 210 | 210 |
| 211 // DictionaryPrefUpdate overrides: | 211 // DictionaryPrefUpdate overrides: |
| 212 virtual base::DictionaryValue* Get() OVERRIDE { | 212 virtual base::DictionaryValue* Get() override { |
| 213 base::DictionaryValue* dict = DictionaryPrefUpdate::Get(); | 213 base::DictionaryValue* dict = DictionaryPrefUpdate::Get(); |
| 214 base::DictionaryValue* extension = NULL; | 214 base::DictionaryValue* extension = NULL; |
| 215 if (!dict->GetDictionary(extension_id_, &extension)) { | 215 if (!dict->GetDictionary(extension_id_, &extension)) { |
| 216 // Extension pref does not exist, create it. | 216 // Extension pref does not exist, create it. |
| 217 extension = new base::DictionaryValue(); | 217 extension = new base::DictionaryValue(); |
| 218 dict->SetWithoutPathExpansion(extension_id_, extension); | 218 dict->SetWithoutPathExpansion(extension_id_, extension); |
| 219 } | 219 } |
| 220 return extension; | 220 return extension; |
| 221 } | 221 } |
| 222 | 222 |
| (...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 extension_pref_value_map_->RegisterExtension( | 2159 extension_pref_value_map_->RegisterExtension( |
| 2160 extension_id, install_time, is_enabled, is_incognito_enabled); | 2160 extension_id, install_time, is_enabled, is_incognito_enabled); |
| 2161 | 2161 |
| 2162 FOR_EACH_OBSERVER( | 2162 FOR_EACH_OBSERVER( |
| 2163 ExtensionPrefsObserver, | 2163 ExtensionPrefsObserver, |
| 2164 observer_list_, | 2164 observer_list_, |
| 2165 OnExtensionRegistered(extension_id, install_time, is_enabled)); | 2165 OnExtensionRegistered(extension_id, install_time, is_enabled)); |
| 2166 } | 2166 } |
| 2167 | 2167 |
| 2168 } // namespace extensions | 2168 } // namespace extensions |
| OLD | NEW |