| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 const std::string& extension_id) const { | 1252 const std::string& extension_id) const { |
| 1253 const base::DictionaryValue* ext = NULL; | 1253 const base::DictionaryValue* ext = NULL; |
| 1254 const base::DictionaryValue* extensions = | 1254 const base::DictionaryValue* extensions = |
| 1255 prefs_->GetDictionary(pref_names::kExtensions); | 1255 prefs_->GetDictionary(pref_names::kExtensions); |
| 1256 if (!extensions || | 1256 if (!extensions || |
| 1257 !extensions->GetDictionaryWithoutPathExpansion(extension_id, &ext)) | 1257 !extensions->GetDictionaryWithoutPathExpansion(extension_id, &ext)) |
| 1258 return std::unique_ptr<ExtensionInfo>(); | 1258 return std::unique_ptr<ExtensionInfo>(); |
| 1259 int state_value; | 1259 int state_value; |
| 1260 if (ext->GetInteger(kPrefState, &state_value) && | 1260 if (ext->GetInteger(kPrefState, &state_value) && |
| 1261 state_value == Extension::EXTERNAL_EXTENSION_UNINSTALLED) { | 1261 state_value == Extension::EXTERNAL_EXTENSION_UNINSTALLED) { |
| 1262 LOG(WARNING) << "External extension with id " << extension_id | |
| 1263 << " has been uninstalled by the user"; | |
| 1264 return std::unique_ptr<ExtensionInfo>(); | 1262 return std::unique_ptr<ExtensionInfo>(); |
| 1265 } | 1263 } |
| 1266 | 1264 |
| 1267 return GetInstalledInfoHelper(extension_id, ext); | 1265 return GetInstalledInfoHelper(extension_id, ext); |
| 1268 } | 1266 } |
| 1269 | 1267 |
| 1270 std::unique_ptr<ExtensionPrefs::ExtensionsInfo> | 1268 std::unique_ptr<ExtensionPrefs::ExtensionsInfo> |
| 1271 ExtensionPrefs::GetInstalledExtensionsInfo() const { | 1269 ExtensionPrefs::GetInstalledExtensionsInfo() const { |
| 1272 std::unique_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); | 1270 std::unique_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); |
| 1273 | 1271 |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 extension_pref_value_map_->RegisterExtension( | 1983 extension_pref_value_map_->RegisterExtension( |
| 1986 extension_id, install_time, is_enabled, is_incognito_enabled); | 1984 extension_id, install_time, is_enabled, is_incognito_enabled); |
| 1987 | 1985 |
| 1988 FOR_EACH_OBSERVER( | 1986 FOR_EACH_OBSERVER( |
| 1989 ExtensionPrefsObserver, | 1987 ExtensionPrefsObserver, |
| 1990 observer_list_, | 1988 observer_list_, |
| 1991 OnExtensionRegistered(extension_id, install_time, is_enabled)); | 1989 OnExtensionRegistered(extension_id, install_time, is_enabled)); |
| 1992 } | 1990 } |
| 1993 | 1991 |
| 1994 } // namespace extensions | 1992 } // namespace extensions |
| OLD | NEW |