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

Unified Diff: views/controls/menu/native_menu_gtk.h

Issue 383012: Fix for issue 27210, show bookmarks bar menu is out of sync with the browser's status. (Closed)
Patch Set: Created 11 years, 1 month 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/chromeos/status_area_view.cc ('k') | views/controls/menu/native_menu_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/native_menu_gtk.h
diff --git a/views/controls/menu/native_menu_gtk.h b/views/controls/menu/native_menu_gtk.h
index 768fada2f35b3c6fa91f873d51e7ded5c5d626dd..92c500dfdc061a764e71f2221da0ac3c4a61eedc 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);
};
« no previous file with comments | « chrome/browser/chromeos/status_area_view.cc ('k') | views/controls/menu/native_menu_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698