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 e8f714e790df4f45207378b987576144747d3edd..129626b4d55979935e58a436bdf24b783c9a2ec3 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); |
@@ -456,4 +466,10 @@ void ActivityLog::RemoveURL(const GURL& url) { |
RemoveURLs(urls); |
} |
+void ActivityLog::DeleteDatabase() { |
+ if (!policy_) |
+ return; |
+ policy_->DeleteDatabase(); |
+} |
+ |
} // namespace extensions |