| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 24 matching lines...) Expand all Loading... |
| 35 virtual void CommandWillBeExecuted() {} | 35 virtual void CommandWillBeExecuted() {} |
| 36 | 36 |
| 37 // Called when the menu stops showing. This will be called before | 37 // Called when the menu stops showing. This will be called before |
| 38 // ExecuteCommand if the user clicks an item, but will also be called when | 38 // ExecuteCommand if the user clicks an item, but will also be called when |
| 39 // the user clicks away from the menu. | 39 // the user clicks away from the menu. |
| 40 virtual void StoppedShowing() {} | 40 virtual void StoppedShowing() {} |
| 41 | 41 |
| 42 // Return true if we should override the "gtk-menu-images" system setting | 42 // Return true if we should override the "gtk-menu-images" system setting |
| 43 // when showing image menu items for this menu. | 43 // when showing image menu items for this menu. |
| 44 virtual bool AlwaysShowImages() const { return false; } | 44 virtual bool AlwaysShowImages() const { return false; } |
| 45 |
| 46 // Returns a tinted image used in button in a menu. |
| 47 virtual GtkIconSet* GetIconSetForId(int idr) { return NULL; } |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 MenuGtk(MenuGtk::Delegate* delegate, menus::MenuModel* model); | 50 MenuGtk(MenuGtk::Delegate* delegate, menus::MenuModel* model); |
| 48 ~MenuGtk(); | 51 ~MenuGtk(); |
| 49 | 52 |
| 50 // Initialize GTK signal handlers. | 53 // Initialize GTK signal handlers. |
| 51 void ConnectSignalHandlers(); | 54 void ConnectSignalHandlers(); |
| 52 | 55 |
| 53 // These methods are used to build the menu dynamically. The return value | 56 // These methods are used to build the menu dynamically. The return value |
| 54 // is the new menu item. | 57 // is the new menu item. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // menu. | 165 // menu. |
| 163 static bool block_activation_; | 166 static bool block_activation_; |
| 164 | 167 |
| 165 // We must free these at shutdown. | 168 // We must free these at shutdown. |
| 166 std::vector<MenuGtk*> submenus_we_own_; | 169 std::vector<MenuGtk*> submenus_we_own_; |
| 167 | 170 |
| 168 ScopedRunnableMethodFactory<MenuGtk> factory_; | 171 ScopedRunnableMethodFactory<MenuGtk> factory_; |
| 169 }; | 172 }; |
| 170 | 173 |
| 171 #endif // CHROME_BROWSER_GTK_MENU_GTK_H_ | 174 #endif // CHROME_BROWSER_GTK_MENU_GTK_H_ |
| OLD | NEW |