diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-13 22:22:23 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-13 22:22:23 +0000 |
commit | 8b280303f86249ce8d13916fcda774a3129ac9ac (patch) | |
tree | f015f72f91927f0651cfcf1b2d5123ae5de89154 /chrome/browser/extensions/extension_menu_manager.cc | |
parent | c08950d205ff5366e6e26059cd6568cb89b28c90 (diff) | |
download | chromium_src-8b280303f86249ce8d13916fcda774a3129ac9ac.zip chromium_src-8b280303f86249ce8d13916fcda774a3129ac9ac.tar.gz chromium_src-8b280303f86249ce8d13916fcda774a3129ac9ac.tar.bz2 |
Fix some AllSources observers of EXTENSION_UNLOADED.
Most such observers use it to remove state they are tracking about particular extensions. extension_menu_manager should be okay even without this. desktop_notification_service might have had subtle wrongness.
BUG=99391
TEST=existing tests
Review URL: http://codereview.chromium.org/8253005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_menu_manager.cc')
-rw-r--r-- | chrome/browser/extensions/extension_menu_manager.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_menu_manager.cc b/chrome/browser/extensions/extension_menu_manager.cc index eb2038e..cf282d4 100644 --- a/chrome/browser/extensions/extension_menu_manager.cc +++ b/chrome/browser/extensions/extension_menu_manager.cc @@ -92,9 +92,9 @@ void ExtensionMenuItem::AddChild(ExtensionMenuItem* item) { children_.push_back(item); } -ExtensionMenuManager::ExtensionMenuManager() { +ExtensionMenuManager::ExtensionMenuManager(Profile* profile) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, - NotificationService::AllSources()); + Source<Profile>(profile)); } ExtensionMenuManager::~ExtensionMenuManager() { @@ -449,11 +449,9 @@ void ExtensionMenuManager::ExecuteCommand( void ExtensionMenuManager::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { + DCHECK(type == chrome::NOTIFICATION_EXTENSION_UNLOADED); + // Remove menu items for disabled/uninstalled extensions. - if (type != chrome::NOTIFICATION_EXTENSION_UNLOADED) { - NOTREACHED(); - return; - } const Extension* extension = Details<UnloadedExtensionInfo>(details)->extension; if (ContainsKey(context_items_, extension->id())) { |