Chromium Code Reviews| Index: app/menus/menu_model.h |
| =================================================================== |
| --- app/menus/menu_model.h (revision 70178) |
| +++ app/menus/menu_model.h (working copy) |
| @@ -38,6 +38,14 @@ |
| TYPE_SUBMENU |
| }; |
| + class Delegate { |
| + public: |
| + // Invoked when an icon has been loaded from history. |
| + virtual void OnIconChanged(int model_index) {} |
|
sky
2011/01/04 21:51:15
model_index -> index. No where else does the API t
|
| + protected: |
| + virtual ~Delegate() {} |
| + }; |
| + |
| // Returns true if any of the items within the model have icons. Not all |
| // platforms support icons in menus natively and so this is a hint for |
| // triggering a custom rendering mode. |
| @@ -87,7 +95,7 @@ |
| // Gets the icon for the item at the specified index, returning true if there |
| // is an icon, false otherwise. |
| - virtual bool GetIconAt(int index, SkBitmap* icon) const = 0; |
| + virtual bool GetIconAt(int index, SkBitmap* icon) = 0; |
| // Returns the model for a menu item with a line of buttons at |index|. |
| virtual ButtonMenuItemModel* GetButtonMenuItemAt(int index) const = 0; |
| @@ -115,6 +123,9 @@ |
| // Called when the menu is about to be shown. |
| virtual void MenuWillShow() {} |
| + // Set the Delegate |
| + virtual void SetDelegate(Delegate* delegate) = 0; |
| + |
| // Retrieves the model and index that contains a specific command id. Returns |
| // true if an item with the specified command id is found. |model| is inout, |
| // and specifies the model to start searching from. |