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

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: Minor fix before review 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
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_log/activity_log_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2b9f368851d6a393eeed06056cfec1e40b3da886 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))
Matt Perry 2013/09/09 19:02:02 nit: I'd restructure these two ifs to an if-else o
felt 2013/09/09 21:19:44 Done, although sadly it's still rather ugly.
+ 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);
}
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_log/activity_log_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698