Index: chrome/browser/extensions/activity_log/activity_log.cc |
diff --git a/chrome/browser/extensions/activity_log/activity_log.cc b/chrome/browser/extensions/activity_log/activity_log.cc |
index e7ed2c1e79ffa16ff8bcbdcd3d32455b172562ac..5286f59a4cab0c59490c41445b9549361387f19f 100644 |
--- a/chrome/browser/extensions/activity_log/activity_log.cc |
+++ b/chrome/browser/extensions/activity_log/activity_log.cc |
@@ -302,6 +302,11 @@ ActivityLogFactory::ActivityLogFactory() |
DependsOn(InstallTrackerFactory::GetInstance()); |
} |
+// static |
+ActivityLog* ActivityLog::GetInstance(Profile* profile) { |
+ return ActivityLogFactory::GetForProfile(profile); |
+} |
+ |
ActivityLogFactory::~ActivityLogFactory() { |
} |
@@ -444,20 +449,20 @@ void ActivityLog::OnExtensionUnloaded(const Extension* extension) { |
} |
void ActivityLog::OnExtensionUninstalled(const Extension* extension) { |
+ if (!policy_) |
+ return; |
// If the extension has been uninstalled but not disabled, we delete the |
// database. |
- if (extension->id() != kActivityLogExtensionId) return; |
- if (!CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableExtensionActivityLogging)) { |
- DeleteDatabase(); |
+ if (extension->id() == kActivityLogExtensionId) { |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableExtensionActivityLogging)) { |
+ DeleteDatabase(); |
+ } |
+ } else { |
+ policy_->RemoveExtensionData(extension->id()); |
} |
} |
-// static |
-ActivityLog* ActivityLog::GetInstance(Profile* profile) { |
- return ActivityLogFactory::GetForProfile(profile); |
-} |
- |
void ActivityLog::AddObserver(ActivityLog::Observer* observer) { |
observers_->AddObserver(observer); |
} |