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

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: Fixed bug in test 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 e7ed2c1e79ffa16ff8bcbdcd3d32455b172562ac..5286f59a4cab0c59490c41445b9549361387f19f 100644
--- a/chrome/browser/extensions/activity_log/activity_log.cc
+++ b/chrome/browser/extensions/activity_log/activity_log.cc
@@ -302,6 +302,11 @@ ActivityLogFactory::ActivityLogFactory()
DependsOn(InstallTrackerFactory::GetInstance());
}
+// static
+ActivityLog* ActivityLog::GetInstance(Profile* profile) {
+ return ActivityLogFactory::GetForProfile(profile);
+}
+
ActivityLogFactory::~ActivityLogFactory() {
}
@@ -444,20 +449,20 @@ void ActivityLog::OnExtensionUnloaded(const Extension* extension) {
}
void ActivityLog::OnExtensionUninstalled(const Extension* extension) {
+ if (!policy_)
+ return;
// 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 (extension->id() == kActivityLogExtensionId) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExtensionActivityLogging)) {
+ DeleteDatabase();
+ }
+ } else {
+ policy_->RemoveExtensionData(extension->id());
}
}
-// 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