OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 gtk_widget_get_allocation(widget, &allocation); | 113 gtk_widget_get_allocation(widget, &allocation); |
114 alternate_y -= allocation.height; | 114 alternate_y -= allocation.height; |
115 } | 115 } |
116 if (menu_bottom >= screen_bottom && alternate_y >= screen_top) | 116 if (menu_bottom >= screen_bottom && alternate_y >= screen_top) |
117 return alternate_y; | 117 return alternate_y; |
118 return y; | 118 return y; |
119 } | 119 } |
120 | 120 |
121 } // namespace | 121 } // namespace |
122 | 122 |
| 123 bool MenuGtk::Delegate::AlwaysShowIconForCmd(int command_id) const { |
| 124 return false; |
| 125 } |
| 126 |
| 127 GtkIconSet* MenuGtk::Delegate::GetIconSetForId(int idr) { return NULL; } |
| 128 |
123 GtkWidget* MenuGtk::Delegate::GetDefaultImageForCommandId(int command_id) { | 129 GtkWidget* MenuGtk::Delegate::GetDefaultImageForCommandId(int command_id) { |
124 const char* stock; | 130 const char* stock; |
125 switch (command_id) { | 131 switch (command_id) { |
126 case IDC_NEW_TAB: | 132 case IDC_NEW_TAB: |
127 case IDC_CONTENT_CONTEXT_OPENIMAGENEWTAB: | 133 case IDC_CONTENT_CONTEXT_OPENIMAGENEWTAB: |
128 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: | 134 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: |
129 case IDC_CONTENT_CONTEXT_OPENAVNEWTAB: | 135 case IDC_CONTENT_CONTEXT_OPENAVNEWTAB: |
130 stock = GTK_STOCK_NEW; | 136 stock = GTK_STOCK_NEW; |
131 break; | 137 break; |
132 | 138 |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 gtk_widget_hide(widget); | 902 gtk_widget_hide(widget); |
897 } | 903 } |
898 | 904 |
899 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); | 905 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); |
900 if (submenu) { | 906 if (submenu) { |
901 gtk_container_foreach(GTK_CONTAINER(submenu), &SetMenuItemInfo, | 907 gtk_container_foreach(GTK_CONTAINER(submenu), &SetMenuItemInfo, |
902 userdata); | 908 userdata); |
903 } | 909 } |
904 } | 910 } |
905 } | 911 } |
OLD | NEW |