Index: ui/base/models/menu_model.h |
diff --git a/ui/base/models/menu_model.h b/ui/base/models/menu_model.h |
index d838a56297e69ec2efdd90edd1e7123d851cff5a..c04a40cf566321529813de285e28c937828c8b2d 100644 |
--- a/ui/base/models/menu_model.h |
+++ b/ui/base/models/menu_model.h |
@@ -36,6 +36,14 @@ class MenuModel { |
virtual ~MenuModel() {} |
+ class Delegate { |
sky
2011/02/22 18:28:28
Move this into its own file and call it MenuModelD
dill
2011/02/24 15:00:28
This should go in ui\base\models, correct?
On 201
sky
2011/02/24 15:12:50
yes.
|
+ public: |
+ // Invoked when an icon has been loaded from history. |
+ virtual void OnIconChanged(int index) {} |
+ 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. |
@@ -85,7 +93,7 @@ class MenuModel { |
// 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; |
@@ -116,6 +124,9 @@ class MenuModel { |
// Called when the menu has been closed. |
virtual void MenuClosed() {} |
+ // Set the Delegate |
sky
2011/02/22 18:28:28
End with period, and mention not-owned.
|
+ 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. |