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

Unified Diff: chrome/browser/gtk/menu_bar_helper.h

Issue 1783010: GTK: more signal handler foolproofing. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 8 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/gtk/gtk_theme_provider.cc ('k') | chrome/browser/gtk/menu_bar_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/menu_bar_helper.h
diff --git a/chrome/browser/gtk/menu_bar_helper.h b/chrome/browser/gtk/menu_bar_helper.h
index 9b6448c808dbf9b5054fc8175bc009fc9f4bf7bd..05d68193b887430830a3925927214729bbdb121c 100644
--- a/chrome/browser/gtk/menu_bar_helper.h
+++ b/chrome/browser/gtk/menu_bar_helper.h
@@ -13,6 +13,9 @@
#include <vector>
+#include "app/gtk_signal.h"
+#include "base/scoped_ptr.h"
+
class MenuBarHelper {
public:
class Delegate {
@@ -43,24 +46,11 @@ class MenuBarHelper {
void Clear();
private:
- static gboolean OnMenuMotionNotifyThunk(GtkWidget* menu,
- GdkEventMotion* motion,
- MenuBarHelper* helper) {
- return helper->OnMenuMotionNotify(menu, motion);
- }
- gboolean OnMenuMotionNotify(GtkWidget* menu, GdkEventMotion* motion);
-
- static void OnMenuHiddenThunk(GtkWidget* menu, MenuBarHelper* helper) {
- helper->OnMenuHidden(menu);
- }
- void OnMenuHidden(GtkWidget* menu);
-
- static void OnMenuMoveCurrentThunk(GtkWidget* menu,
- GtkMenuDirectionType dir,
- MenuBarHelper* helper) {
- helper->OnMenuMoveCurrent(menu, dir);
- }
- void OnMenuMoveCurrent(GtkWidget* menu, GtkMenuDirectionType dir);
+ CHROMEGTK_CALLBACK_1(MenuBarHelper, gboolean, OnMenuMotionNotify,
+ GdkEventMotion*);
+ CHROMEGTK_CALLBACK_0(MenuBarHelper, void, OnMenuHidden);
+ CHROMEGTK_CALLBACK_1(MenuBarHelper, void, OnMenuMoveCurrent,
+ GtkMenuDirectionType);
// The buttons for which we pop up menus. We do not own these, or even add
// refs to them.
@@ -76,6 +66,10 @@ class MenuBarHelper {
// of them.
std::vector<GtkWidget*> submenus_;
+ // Signal handlers that are attached only between the "show" and "hide" events
+ // for the menu.
+ scoped_ptr<GtkSignalRegistrar> signal_handlers_;
+
Delegate* delegate_;
};
« no previous file with comments | « chrome/browser/gtk/gtk_theme_provider.cc ('k') | chrome/browser/gtk/menu_bar_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698