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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_gtk.h

Issue 9693047: Add Extension Keybinding test for page actions. This is to facilitate an upcoming port of the PageA… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
Index: chrome/browser/ui/gtk/location_bar_view_gtk.h
===================================================================
--- chrome/browser/ui/gtk/location_bar_view_gtk.h (revision 126791)
+++ chrome/browser/ui/gtk/location_bar_view_gtk.h (working copy)
@@ -48,6 +48,10 @@
class WebContents;
}
+namespace ui {
+class AcceleratorGtk;
+}
+
class LocationBarViewGtk : public AutocompleteEditController,
public LocationBar,
public LocationBarTesting,
@@ -207,6 +211,7 @@
};
class PageActionViewGtk : public ImageLoadingTracker::Observer,
+ public content::NotificationObserver,
public ExtensionContextMenuModel::PopupDelegate {
public:
PageActionViewGtk(LocationBarViewGtk* owner, ExtensionAction* page_action);
@@ -235,6 +240,11 @@
// Simulate left mouse click on the page action button.
void TestActivatePageAction();
+ // Implement the content::NotificationObserver interface.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
// Overridden from ExtensionContextMenuModel::PopupDelegate:
virtual void InspectPopup(ExtensionAction* action) OVERRIDE;
@@ -243,11 +253,26 @@
// with a debugger window attached. Returns true if a popup was shown.
bool ShowPopup(bool devtools);
+ // Connect the accelerator for the page action popup.
+ void ConnectPageActionAccelerator();
+
+ // Disconnect the accelerator for the page action popup.
+ void DisconnectPageActionAccelerator();
+
CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnButtonPressed,
GdkEventButton*);
CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnExposeEvent,
GdkEventExpose*);
+ CHROMEGTK_CALLBACK_0(PageActionViewGtk, void, OnRealize);
+ // The accelerator handler for when the shortcuts to open the popup is
+ // struck.
+ static gboolean OnGtkAccelerator(GtkAccelGroup* accel_group,
+ GObject* acceleratable,
+ guint keyval,
+ GdkModifierType modifier,
+ void* user_data);
+
// The location bar view that owns us.
LocationBarViewGtk* owner_;
@@ -279,6 +304,18 @@
// The URL we are currently showing the icon for.
GURL current_url_;
+ // The native browser window of the location bar that owns us.
+ gfx::NativeWindow window_;
+
+ // The Notification registrar.
+ content::NotificationRegistrar registrar_;
+
+ // The accelerator group used to handle accelerators, owned by this object.
+ GtkAccelGroup* accel_group_;
+
+ // The keybinding accelerator registered to show the page action popup.
+ scoped_ptr<ui::AcceleratorGtk> keybinding_;
+
// This is used for post-install visual feedback. The page_action icon
// is briefly shown even if it hasn't been enabled by its extension.
bool preview_enabled_;

Powered by Google App Engine
This is Rietveld 408576698