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

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

Issue 10889052: Display action box menu on Linux/gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes spurious \n Created 8 years, 4 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/action_box_button_gtk.h
diff --git a/chrome/browser/ui/gtk/action_box_button_gtk.h b/chrome/browser/ui/gtk/action_box_button_gtk.h
index cec0f95a7036c59cabfb9f1c61baadf4b14c9771..9356e5c2a175597fb1f1c15f6dbc3462715e66d8 100644
--- a/chrome/browser/ui/gtk/action_box_button_gtk.h
+++ b/chrome/browser/ui/gtk/action_box_button_gtk.h
@@ -7,31 +7,43 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/gtk/menu_gtk.h"
#include "ui/base/gtk/gtk_signal.h"
+class ActionBoxMenuModel;
class Browser;
class CustomDrawButton;
+class MenuGtk;
msw 2012/08/30 03:39:22 nit: forward decl is redundant with include.
beaudoin 2012/08/30 20:55:05 Done.
typedef struct _GtkWidget GtkWidget;
// This class displays the action box button with an associated menu. This is
// where extension actions and the bookmark star live.
-class ActionBoxButtonGtk {
+class ActionBoxButtonGtk : MenuGtk::Delegate {
msw 2012/08/30 03:39:22 nit: explicitly specify public inheritance.
beaudoin 2012/08/30 20:55:05 Done.
public:
explicit ActionBoxButtonGtk(Browser* browser);
virtual ~ActionBoxButtonGtk();
+ // MenuGtk::Delegate implementation.
+ virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE;
+
GtkWidget* widget();
private:
- // Executes the browser command.
- CHROMEGTK_CALLBACK_0(ActionBoxButtonGtk, void, OnClick);
+ // Show the action box menu.
+ CHROMEGTK_CALLBACK_1(ActionBoxButtonGtk, gboolean, OnButtonPress,
+ GdkEventButton*);
scoped_ptr<CustomDrawButton> button_;
// The browser to which we will send commands.
Browser* browser_;
+ // The model and menu displayed when the button is clicked. The menu is
+ // recreated every time it is displayed.
+ scoped_ptr<ActionBoxMenuModel> model_;
+ scoped_ptr<MenuGtk> menu_;
+
DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonGtk);
};
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/action_box_button_gtk.cc » ('j') | chrome/browser/ui/gtk/location_bar_view_gtk.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698