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

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: Undoing last commit Created 7 years, 3 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 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
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log.h ('k') | chrome/browser/extensions/activity_log/activity_log_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698