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

Unified Diff: chrome/browser/extensions/api/alarms/alarm_manager.cc

Issue 18713004: Clear existing alarms when uninstalling extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/alarms/alarm_manager.cc
diff --git a/chrome/browser/extensions/api/alarms/alarm_manager.cc b/chrome/browser/extensions/api/alarms/alarm_manager.cc
index 74b1e03bbd61e9be7df5eb9f4516a211a23f1789..cc4385532aa831358db2f101387f1dd329bf4151 100644
--- a/chrome/browser/extensions/api/alarms/alarm_manager.cc
+++ b/chrome/browser/extensions/api/alarms/alarm_manager.cc
@@ -97,6 +97,8 @@ AlarmManager::AlarmManager(Profile* profile)
delegate_(new DefaultAlarmDelegate(profile)) {
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
content::Source<Profile>(profile_));
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
+ content::Source<Profile>(profile_));
StateStore* storage = ExtensionSystem::Get(profile_)->state_store();
if (storage)
@@ -344,6 +346,12 @@ void AlarmManager::Observe(
}
break;
}
+ case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: {
+ const Extension* extension =
+ content::Details<const Extension>(details).ptr();
+ RemoveAllAlarms(extension->id());
+ break;
+ }
default:
NOTREACHED();
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698