Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2485)

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 1157005: Fix 2 bugs related to remembering loaded unpacked extensions. (Closed)
Patch Set: review feedback 2 Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index db233aab64d7d1b7f0342e8289816c48361a0bb3..4c3e0398b7355ca7f2873cd776b3163ce4ea9412 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -59,7 +59,7 @@ class InstalledExtensionSet {
public:
explicit InstalledExtensionSet(ExtensionPrefs* prefs) {
scoped_ptr<ExtensionPrefs::ExtensionsInfo> info(
- ExtensionPrefs::CollectExtensionsInfo(prefs));
+ prefs->GetInstalledExtensionsInfo());
for (size_t i = 0; i < info->size(); ++i) {
std::string version;
@@ -247,11 +247,19 @@ void ExtensionsService::ReloadExtension(const std::string& extension_id) {
path = unloaded_extension_paths_[extension_id];
}
- // We should always be able to remember the extension's path. If it's not in
- // the map, someone failed to update |unloaded_extension_paths_|.
- CHECK(!path.empty());
-
- LoadExtension(path);
+ // Check the installed extensions to see if what we're reloading was already
+ // installed.
+ scoped_ptr<ExtensionInfo> installed_extension(
+ extension_prefs_->GetInstalledExtensionInfo(extension_id));
+ if (installed_extension.get() &&
+ installed_extension->extension_manifest.get()) {
+ LoadInstalledExtension(*installed_extension, false);
+ } else {
+ // We should always be able to remember the extension's path. If it's not in
+ // the map, someone failed to update |unloaded_extension_paths_|.
+ CHECK(!path.empty());
+ LoadExtension(path);
+ }
}
void ExtensionsService::UninstallExtension(const std::string& extension_id,
@@ -368,7 +376,7 @@ void ExtensionsService::LoadAllExtensions() {
// Load the previously installed extensions.
scoped_ptr<ExtensionPrefs::ExtensionsInfo> info(
- ExtensionPrefs::CollectExtensionsInfo(extension_prefs_.get()));
+ extension_prefs_->GetInstalledExtensionsInfo());
// If any extensions need localization, we bounce them all to the file thread
// for re-reading and localization.
@@ -738,7 +746,7 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension,
// Extension has changed permissions significantly. Disable it. We
// send a notification below.
extension_prefs_->SetExtensionState(extension, Extension::DISABLED);
- extension_prefs_->SetShowInstallWarningOnEnable(extension, true);
+ extension_prefs_->SetDidExtensionEscalatePermissions(extension, true);
}
} else {
// We already have the extension of the same or older version.
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698