Chromium Code Reviews| 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); |
| } |