diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-08 18:20:58 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-08 18:20:58 +0000 |
commit | 460c3f128621f6ce0f2d0752958d14f2ef12960b (patch) | |
tree | 4fc4048fbc91b5800fb416328e7e7c4f002bc0ee /views | |
parent | af236116a2c0b998cee7517acf647ffd1d91d67b (diff) | |
download | chromium_src-460c3f128621f6ce0f2d0752958d14f2ef12960b.zip chromium_src-460c3f128621f6ce0f2d0752958d14f2ef12960b.tar.gz chromium_src-460c3f128621f6ce0f2d0752958d14f2ef12960b.tar.bz2 |
Re-insert IP address in Network Menu.
BUG=chromium-os:8476
TEST=Open the network menu on ChromeOS; the IP address should be at the bottom of the menu.
Review URL: http://codereview.chromium.org/4544001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/menu/native_menu_gtk.cc | 10 | ||||
-rw-r--r-- | views/controls/menu/native_menu_gtk.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/views/controls/menu/native_menu_gtk.cc b/views/controls/menu/native_menu_gtk.cc index 1a9c241..b648878 100644 --- a/views/controls/menu/native_menu_gtk.cc +++ b/views/controls/menu/native_menu_gtk.cc @@ -380,6 +380,7 @@ GtkWidget* NativeMenuGtk::AddMenuItemAt(int index, g_object_set_data(G_OBJECT(menu_item), kPositionString, reinterpret_cast<void*>(index)); g_signal_connect(menu_item, "activate", G_CALLBACK(CallActivate), this); + UpdateMenuItemState(menu_item, false); gtk_widget_show(menu_item); gtk_menu_append(menu_, menu_item); @@ -398,7 +399,7 @@ void NativeMenuGtk::ResetMenu() { } } -void NativeMenuGtk::UpdateMenuItemState(GtkWidget* menu_item) { +void NativeMenuGtk::UpdateMenuItemState(GtkWidget* menu_item, bool recurse) { int index = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menu_item), kPositionString)); @@ -409,8 +410,9 @@ void NativeMenuGtk::UpdateMenuItemState(GtkWidget* menu_item) { model_->IsItemCheckedAt(index)); suppress_activate_signal_ = false; } - // Recurse into submenus, too. - if (GTK_IS_MENU_ITEM(menu_item)) { + + if (recurse && GTK_IS_MENU_ITEM(menu_item)) { + // Recurse into submenus. if (gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu_item))) { Menu2* submenu = reinterpret_cast<Menu2*>(g_object_get_data(G_OBJECT(menu_item), @@ -424,7 +426,7 @@ void NativeMenuGtk::UpdateMenuItemState(GtkWidget* menu_item) { // static void NativeMenuGtk::UpdateStateCallback(GtkWidget* menu_item, gpointer data) { NativeMenuGtk* menu = reinterpret_cast<NativeMenuGtk*>(data); - menu->UpdateMenuItemState(menu_item); + menu->UpdateMenuItemState(menu_item, true); } // static diff --git a/views/controls/menu/native_menu_gtk.h b/views/controls/menu/native_menu_gtk.h index 4278d2c..99d65cc 100644 --- a/views/controls/menu/native_menu_gtk.h +++ b/views/controls/menu/native_menu_gtk.h @@ -67,7 +67,7 @@ class NativeMenuGtk : public MenuWrapper, void ResetMenu(); // Updates the menu item's state. - void UpdateMenuItemState(GtkWidget* menu_item); + void UpdateMenuItemState(GtkWidget* menu_item, bool recurse); static void UpdateStateCallback(GtkWidget* menu_item, gpointer data); |