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

Unified Diff: chrome/browser/ui/views/browser_actions_container.h

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | « chrome/browser/external_tab_container_win.cc ('k') | chrome/browser/ui/views/browser_actions_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/browser_actions_container.h
===================================================================
--- chrome/browser/ui/views/browser_actions_container.h (revision 123221)
+++ chrome/browser/ui/views/browser_actions_container.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,12 +15,14 @@
#include "base/memory/weak_ptr.h"
#include "base/message_loop_helpers.h"
#include "chrome/browser/extensions/extension_context_menu_model.h"
+#include "chrome/browser/extensions/extension_keybinding_registry.h"
#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
#include "chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.h"
#include "chrome/browser/ui/views/extensions/extension_popup.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "ui/base/accelerators/accelerator.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/tween.h"
#include "ui/views/controls/button/menu_button.h"
@@ -104,6 +106,9 @@
virtual void ShowContextMenu(const gfx::Point& p,
bool is_mouse_gesture) OVERRIDE;
+ // Overridden from ui::AcceleratorTarget.
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+
// Notifications when to set button state to pushed/not pushed (for when the
// popup/context menu is hidden or shown by the container).
void SetButtonPushed();
@@ -141,6 +146,10 @@
content::NotificationRegistrar registrar_;
+ // The extension keybinding accelerator this browser action is listening for
+ // (to show the popup).
+ scoped_ptr<ui::Accelerator> keybinding_;
+
friend class base::DeleteHelper<BrowserActionButton>;
DISALLOW_COPY_AND_ASSIGN(BrowserActionButton);
@@ -495,6 +504,9 @@
// own lifetime so that it can stay alive during drag and drop operations.
BrowserActionOverflowMenuController* overflow_menu_;
+ // The class that registers for keyboard shortcuts for extension commands.
+ ExtensionKeybindingRegistry extension_keybinding_registry_;
+
// The animation that happens when the container snaps to place.
scoped_ptr<ui::SlideAnimation> resize_animation_;
« no previous file with comments | « chrome/browser/external_tab_container_win.cc ('k') | chrome/browser/ui/views/browser_actions_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698