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

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

Issue 23629015: Add deletion to the activityLogPrivate API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up CountingPolicy::DoDeleteDatabase Created 7 years, 4 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
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

Powered by Google App Engine
This is Rietveld 408576698