summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/native_menu_gtk.h
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/menu/native_menu_gtk.h')
-rw-r--r--views/controls/menu/native_menu_gtk.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/views/controls/menu/native_menu_gtk.h b/views/controls/menu/native_menu_gtk.h
index 768fada..92c500d 100644
--- a/views/controls/menu/native_menu_gtk.h
+++ b/views/controls/menu/native_menu_gtk.h
@@ -33,10 +33,13 @@ class NativeMenuGtk : public MenuWrapper {
void AddSeparatorAt(int index);
void AddMenuItemAt(int index, GtkRadioMenuItem** last_radio_item);
- static void UpdateStateCallback(GtkWidget* menu_item, gpointer data);
-
void ResetMenu();
+ // Updates the menu item's state.
+ void UpdateMenuItemState(GtkWidget* menu_item);
+
+ static void UpdateStateCallback(GtkWidget* menu_item, gpointer data);
+
// Callback for gtk_menu_popup to position the menu.
static void MenuPositionFunc(GtkMenu* menu, int* x, int* y, gboolean* push_in,
void* data);
@@ -53,6 +56,11 @@ class NativeMenuGtk : public MenuWrapper {
bool menu_shown_;
+ // A flag used to avoid misfiring ActivateAt call on the menu model.
+ // This is necessary as GTK menu fires an activate signal even when the
+ // state is changed by |UpdateStates()| API.
+ bool suppress_activate_signal_;
+
DISALLOW_COPY_AND_ASSIGN(NativeMenuGtk);
};