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

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

Issue 23983014: [Activity Log] when extension is uninstalled, delete data about it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 204ef3a31423d7c6e30da5846ee312a1178cfe2d..bf01a8e722f5ca6cb68805f16be058991a0de541 100644
--- a/chrome/browser/extensions/activity_log/activity_log.cc
+++ b/chrome/browser/extensions/activity_log/activity_log.cc
@@ -171,6 +171,11 @@ ActivityLogFactory::ActivityLogFactory()
DependsOn(InstallTrackerFactory::GetInstance());
}
+// static
+ActivityLog* ActivityLog::GetInstance(Profile* profile) {
+ return ActivityLogFactory::GetForProfile(profile);
+}
+
ActivityLogFactory::~ActivityLogFactory() {
}
@@ -315,18 +320,15 @@ 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();
+ if (policy_ && extension->id() != kActivityLogExtensionId)
+ policy_->RemoveExtensionData(extension->id());
+ if ((extension->id() == kActivityLogExtensionId) &&
+ (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExtensionActivityLogging))) {
+ DeleteDatabase();
}
}
-// static
-ActivityLog* ActivityLog::GetInstance(Profile* profile) {
- return ActivityLogFactory::GetForProfile(profile);
-}
-
void ActivityLog::AddObserver(ActivityLog::Observer* observer) {
observers_->AddObserver(observer);
}

Powered by Google App Engine
This is Rietveld 408576698