| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_MENU_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_MENU_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_MENU_GTK_H_ | 6 #define CHROME_BROWSER_GTK_MENU_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // ExecuteCommand if the user clicks an item, but will also be called when | 36 // ExecuteCommand if the user clicks an item, but will also be called when |
| 37 // the user clicks away from the menu. | 37 // the user clicks away from the menu. |
| 38 virtual void StoppedShowing() { }; | 38 virtual void StoppedShowing() { }; |
| 39 | 39 |
| 40 // Functions needed for creation of non-static menus. | 40 // Functions needed for creation of non-static menus. |
| 41 virtual int GetItemCount() const { return 0; } | 41 virtual int GetItemCount() const { return 0; } |
| 42 virtual bool IsItemSeparator(int command_id) const { return false; } | 42 virtual bool IsItemSeparator(int command_id) const { return false; } |
| 43 virtual std::string GetLabel(int command_id) const { return std::string(); } | 43 virtual std::string GetLabel(int command_id) const { return std::string(); } |
| 44 virtual bool HasIcon(int command_id) const { return false; } | 44 virtual bool HasIcon(int command_id) const { return false; } |
| 45 virtual const SkBitmap* GetIcon(int command_id) const { return NULL; } | 45 virtual const SkBitmap* GetIcon(int command_id) const { return NULL; } |
| 46 // Return true if we should override the "gtk-menu-images" system setting |
| 47 // when showing image menu items for this menu. |
| 48 virtual bool AlwaysShowImages() const { return false; } |
| 46 }; | 49 }; |
| 47 | 50 |
| 48 // Builds a MenuGtk that uses |delegate| to perform actions and |menu_data| | 51 // Builds a MenuGtk that uses |delegate| to perform actions and |menu_data| |
| 49 // to create the menu. | 52 // to create the menu. |
| 50 MenuGtk(MenuGtk::Delegate* delegate, const MenuCreateMaterial* menu_data, | 53 MenuGtk(MenuGtk::Delegate* delegate, const MenuCreateMaterial* menu_data, |
| 51 GtkAccelGroup* accel_group); | 54 GtkAccelGroup* accel_group); |
| 52 // Creates a MenuGtk that uses |delegate| to perform actions. Builds the | 55 // Creates a MenuGtk that uses |delegate| to perform actions. Builds the |
| 53 // menu using |delegate| if |load| is true. | 56 // menu using |delegate| if |load| is true. |
| 54 MenuGtk(MenuGtk::Delegate* delegate, bool load); | 57 MenuGtk(MenuGtk::Delegate* delegate, bool load); |
| 55 ~MenuGtk(); | 58 ~MenuGtk(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 147 |
| 145 // True when we should ignore "activate" signals. Used to prevent | 148 // True when we should ignore "activate" signals. Used to prevent |
| 146 // menu items from getting activated when we are setting up the | 149 // menu items from getting activated when we are setting up the |
| 147 // menu. | 150 // menu. |
| 148 static bool block_activation_; | 151 static bool block_activation_; |
| 149 | 152 |
| 150 ScopedRunnableMethodFactory<MenuGtk> factory_; | 153 ScopedRunnableMethodFactory<MenuGtk> factory_; |
| 151 }; | 154 }; |
| 152 | 155 |
| 153 #endif // CHROME_BROWSER_GTK_MENU_GTK_H_ | 156 #endif // CHROME_BROWSER_GTK_MENU_GTK_H_ |
| OLD | NEW |