Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/page_action_image_view.cc |
| =================================================================== |
| --- chrome/browser/ui/views/location_bar/page_action_image_view.cc (revision 107550) |
| +++ chrome/browser/ui/views/location_bar/page_action_image_view.cc (working copy) |
| @@ -13,8 +13,13 @@ |
| #include "chrome/browser/ui/browser_list.h" |
| #include "chrome/browser/ui/views/frame/browser_view.h" |
| #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| +#include "chrome/common/chrome_notification_types.h" |
| +#include "chrome/common/extensions/extension.h" |
| #include "chrome/common/extensions/extension_action.h" |
| #include "chrome/common/extensions/extension_resource.h" |
| +#include "content/browser/notification_service_impl.h" |
| +#include "content/public/browser/notification_details.h" |
| +#include "content/public/browser/notification_source.h" |
| #include "ui/base/accessibility/accessible_view_state.h" |
| #include "views/controls/menu/menu_item_view.h" |
| #include "views/controls/menu/menu_model_adapter.h" |
| @@ -47,6 +52,10 @@ |
| ImageLoadingTracker::DONT_CACHE); |
| } |
| + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| + content::Source<Profile>( |
| + owner_->browser()->profile()->GetOriginalProfile())); |
| + |
| set_accessibility_focusable(true); |
| } |
| @@ -225,8 +234,8 @@ |
| } |
| void PageActionImageView::InspectPopup(ExtensionAction* action) { |
| - ExecuteAction(1, // left-click |
| - true); // inspect_with_devtools |
| + ExecuteAction(1, // Left-click. |
| + true); // |inspect_with_devtools|. |
| } |
| void PageActionImageView::ExtensionPopupIsClosing(ExtensionPopup* popup) { |
| @@ -235,6 +244,16 @@ |
| popup_ = NULL; |
| } |
| +void PageActionImageView::Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) { |
| + DCHECK(type == chrome::NOTIFICATION_EXTENSION_UNLOADED); |
|
Aaron Boodman
2011/10/27 16:57:35
Can use _EQ.
|
| + const Extension* unloaded_extension = |
| + content::Details<UnloadedExtensionInfo>(details)->extension; |
| + if (page_action_ == unloaded_extension ->page_action()) |
| + owner_->UpdatePageActions(); |
| +} |
| + |
| void PageActionImageView::HidePopup() { |
| if (popup_) |
| popup_->Close(); |