| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_MENU_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_MENU_UTIL_H_ |
| 6 #define CHROME_BROWSER_UI_LIBGTK2UI_MENU_UTIL_H_ | 6 #define CHROME_BROWSER_UI_LIBGTKUI_MENU_UTIL_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 class MenuModel; | 13 class MenuModel; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace libgtk2ui { | 16 namespace libgtkui { |
| 17 // Builds GtkImageMenuItems. | 17 // Builds GtkImageMenuItems. |
| 18 GtkWidget* BuildMenuItemWithImage(const std::string& label, GtkWidget* image); | 18 GtkWidget* BuildMenuItemWithImage(const std::string& label, GtkWidget* image); |
| 19 GtkWidget* BuildMenuItemWithImage(const std::string& label, | 19 GtkWidget* BuildMenuItemWithImage(const std::string& label, |
| 20 const gfx::Image& icon); | 20 const gfx::Image& icon); |
| 21 GtkWidget* BuildMenuItemWithLabel(const std::string& label); | 21 GtkWidget* BuildMenuItemWithLabel(const std::string& label); |
| 22 | 22 |
| 23 ui::MenuModel* ModelForMenuItem(GtkMenuItem* menu_item); | 23 ui::MenuModel* ModelForMenuItem(GtkMenuItem* menu_item); |
| 24 | 24 |
| 25 // This method is used to build the menu dynamically. The return value is the | 25 // This method is used to build the menu dynamically. The return value is the |
| 26 // new menu item. | 26 // new menu item. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 44 // See comments in definition of SetMenuItemInfo for more info. | 44 // See comments in definition of SetMenuItemInfo for more info. |
| 45 void BuildSubmenuFromModel(ui::MenuModel* model, | 45 void BuildSubmenuFromModel(ui::MenuModel* model, |
| 46 GtkWidget* menu, | 46 GtkWidget* menu, |
| 47 GCallback item_activated_cb, | 47 GCallback item_activated_cb, |
| 48 bool* block_activation, | 48 bool* block_activation, |
| 49 void* this_ptr); | 49 void* this_ptr); |
| 50 | 50 |
| 51 // Sets the check mark, enabled/disabled state and dynamic labels on menu items. | 51 // Sets the check mark, enabled/disabled state and dynamic labels on menu items. |
| 52 void SetMenuItemInfo(GtkWidget* widget, void* block_activation_ptr); | 52 void SetMenuItemInfo(GtkWidget* widget, void* block_activation_ptr); |
| 53 | 53 |
| 54 } // namespace libgtk2ui | 54 } // namespace libgtkui |
| 55 | 55 |
| 56 #endif // CHROME_BROWSER_UI_LIBGTK2UI_MENU_UTIL_H_ | 56 #endif // CHROME_BROWSER_UI_LIBGTKUI_MENU_UTIL_H_ |
| OLD | NEW |