OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/gtk/menu_gtk.h" | 5 #include "chrome/browser/gtk/menu_gtk.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 } | 727 } |
728 | 728 |
729 void MenuGtk::OnMenuShow(GtkWidget* widget) { | 729 void MenuGtk::OnMenuShow(GtkWidget* widget) { |
730 MessageLoop::current()->PostTask(FROM_HERE, | 730 MessageLoop::current()->PostTask(FROM_HERE, |
731 factory_.NewRunnableMethod(&MenuGtk::UpdateMenu)); | 731 factory_.NewRunnableMethod(&MenuGtk::UpdateMenu)); |
732 } | 732 } |
733 | 733 |
734 void MenuGtk::OnMenuHidden(GtkWidget* widget) { | 734 void MenuGtk::OnMenuHidden(GtkWidget* widget) { |
735 if (delegate_) | 735 if (delegate_) |
736 delegate_->StoppedShowing(); | 736 delegate_->StoppedShowing(); |
| 737 model_->MenuClosed(); |
737 } | 738 } |
738 | 739 |
739 // static | 740 // static |
740 void MenuGtk::SetButtonItemInfo(GtkWidget* button, gpointer userdata) { | 741 void MenuGtk::SetButtonItemInfo(GtkWidget* button, gpointer userdata) { |
741 ui::ButtonMenuItemModel* model = | 742 ui::ButtonMenuItemModel* model = |
742 reinterpret_cast<ui::ButtonMenuItemModel*>( | 743 reinterpret_cast<ui::ButtonMenuItemModel*>( |
743 g_object_get_data(G_OBJECT(button), "button-model")); | 744 g_object_get_data(G_OBJECT(button), "button-model")); |
744 int index = GPOINTER_TO_INT(g_object_get_data( | 745 int index = GPOINTER_TO_INT(g_object_get_data( |
745 G_OBJECT(button), "button-model-id")); | 746 G_OBJECT(button), "button-model-id")); |
746 | 747 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 gtk_widget_hide(widget); | 832 gtk_widget_hide(widget); |
832 } | 833 } |
833 | 834 |
834 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); | 835 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); |
835 if (submenu) { | 836 if (submenu) { |
836 gtk_container_foreach(GTK_CONTAINER(submenu), &SetMenuItemInfo, | 837 gtk_container_foreach(GTK_CONTAINER(submenu), &SetMenuItemInfo, |
837 userdata); | 838 userdata); |
838 } | 839 } |
839 } | 840 } |
840 } | 841 } |
OLD | NEW |