Index: chrome/browser/ui/views/toolbar/toolbar_view.cc |
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc |
index 573795fccd7857eeda603eeecd07b73870235446..b006cb6b9fbfb36607b5624af15914e539fc9748 100644 |
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc |
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc |
@@ -14,6 +14,7 @@ |
#include "chrome/app/chrome_command_ids.h" |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/command_updater.h" |
+#include "chrome/browser/extensions/extension_commands_global_registry.h" |
#include "chrome/browser/extensions/extension_util.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/themes/theme_service.h" |
@@ -270,9 +271,21 @@ void ToolbarView::Init() { |
void ToolbarView::OnWidgetVisibilityChanged(views::Widget* widget, |
bool visible) { |
- // Safe to call multiple times; the bubble will only appear once. |
- if (visible) |
+ extensions::ExtensionKeybindingRegistry* registry = NULL; |
+ |
+ if (visible) { |
+ // Safe to call multiple times; the bubble will only appear once. |
extension_message_bubble_factory_->MaybeShow(app_menu_); |
+ registry = browser_actions_->extension_keybinding_registry(); |
+ } |
+ |
+ extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile()) |
+ ->set_active_registry(registry); |
Devlin
2014/09/12 00:10:33
Not quite. We should only set this to NULL if we
David Tseng
2014/09/12 01:26:58
Yup; you're totally right. Done.
|
+} |
+ |
+void ToolbarView::OnWidgetDestroyed(views::Widget* widget) { |
+ extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile()) |
+ ->set_active_registry(NULL); |
} |
void ToolbarView::Update(WebContents* tab) { |