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/ui/gtk/menu_gtk.h" | 5 #include "chrome/browser/ui/gtk/menu_gtk.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 void MenuGtk::WidgetMenuPositionFunc(GtkMenu* menu, | 683 void MenuGtk::WidgetMenuPositionFunc(GtkMenu* menu, |
684 int* x, | 684 int* x, |
685 int* y, | 685 int* y, |
686 gboolean* push_in, | 686 gboolean* push_in, |
687 void* void_widget) { | 687 void* void_widget) { |
688 GtkWidget* widget = GTK_WIDGET(void_widget); | 688 GtkWidget* widget = GTK_WIDGET(void_widget); |
689 GtkRequisition menu_req; | 689 GtkRequisition menu_req; |
690 | 690 |
691 gtk_widget_size_request(GTK_WIDGET(menu), &menu_req); | 691 gtk_widget_size_request(GTK_WIDGET(menu), &menu_req); |
692 | 692 |
693 gdk_window_get_origin(widget->window, x, y); | 693 gdk_window_get_origin(gtk_widget_get_window(widget), x, y); |
694 GdkScreen *screen = gtk_widget_get_screen(widget); | 694 GdkScreen *screen = gtk_widget_get_screen(widget); |
695 gint monitor = gdk_screen_get_monitor_at_point(screen, *x, *y); | 695 gint monitor = gdk_screen_get_monitor_at_point(screen, *x, *y); |
696 | 696 |
697 GdkRectangle screen_rect; | 697 GdkRectangle screen_rect; |
698 gdk_screen_get_monitor_geometry(screen, monitor, | 698 gdk_screen_get_monitor_geometry(screen, monitor, |
699 &screen_rect); | 699 &screen_rect); |
700 | 700 |
701 GtkAllocation allocation; | 701 GtkAllocation allocation; |
702 gtk_widget_get_allocation(widget, &allocation); | 702 gtk_widget_get_allocation(widget, &allocation); |
703 | 703 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 gtk_widget_hide(widget); | 912 gtk_widget_hide(widget); |
913 } | 913 } |
914 | 914 |
915 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); | 915 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); |
916 if (submenu) { | 916 if (submenu) { |
917 gtk_container_foreach(GTK_CONTAINER(submenu), &SetMenuItemInfo, | 917 gtk_container_foreach(GTK_CONTAINER(submenu), &SetMenuItemInfo, |
918 userdata); | 918 userdata); |
919 } | 919 } |
920 } | 920 } |
921 } | 921 } |
OLD | NEW |