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; |