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 7d286f7952dce7fa629f9d5879666e13ac11653c..a44f1c802b1ee1b45783ba9165e8643860e70451 100644 |
--- a/chrome/browser/extensions/activity_log/activity_log.cc |
+++ b/chrome/browser/extensions/activity_log/activity_log.cc |
@@ -312,6 +312,16 @@ void ActivityLog::OnExtensionUnloaded(const Extension* extension) { |
} |
} |
+void ActivityLog::OnExtensionUninstalled(const Extension* extension) { |
+ // 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(); |
+ } |
+} |
+ |
// static |
ActivityLog* ActivityLog::GetInstance(Profile* profile) { |
return ActivityLogFactory::GetForProfile(profile); |
@@ -459,4 +469,10 @@ void ActivityLog::RemoveURL(const GURL& url) { |
RemoveURLs(urls); |
} |
+void ActivityLog::DeleteDatabase() { |
+ if (!policy_) |
+ return; |
+ policy_->DeleteDatabase(); |
+} |
+ |
} // namespace extensions |