Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: app/menus/simple_menu_model.h

Issue 5697005: Change SimpleMenuModel on OSX to support dynamic icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update after merge Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « app/menus/menu_model.h ('k') | app/menus/simple_menu_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 APP_MENUS_SIMPLE_MENU_MODEL_H_ 5 #ifndef APP_MENUS_SIMPLE_MENU_MODEL_H_
6 #define APP_MENUS_SIMPLE_MENU_MODEL_H_ 6 #define APP_MENUS_SIMPLE_MENU_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 16 matching lines...) Expand all
27 virtual bool IsCommandIdChecked(int command_id) const = 0; 27 virtual bool IsCommandIdChecked(int command_id) const = 0;
28 virtual bool IsCommandIdEnabled(int command_id) const = 0; 28 virtual bool IsCommandIdEnabled(int command_id) const = 0;
29 virtual bool IsCommandIdVisible(int command_id) const; 29 virtual bool IsCommandIdVisible(int command_id) const;
30 30
31 // Gets the accelerator for the specified command id. Returns true if the 31 // Gets the accelerator for the specified command id. Returns true if the
32 // command id has a valid accelerator, false otherwise. 32 // command id has a valid accelerator, false otherwise.
33 virtual bool GetAcceleratorForCommandId( 33 virtual bool GetAcceleratorForCommandId(
34 int command_id, 34 int command_id,
35 menus::Accelerator* accelerator) = 0; 35 menus::Accelerator* accelerator) = 0;
36 36
37 // Some command ids have labels that change over time. 37 // Some command ids have labels and icons that change over time.
38 virtual bool IsLabelForCommandIdDynamic(int command_id) const; 38 virtual bool IsItemForCommandIdDynamic(int command_id) const;
39 virtual string16 GetLabelForCommandId(int command_id) const; 39 virtual string16 GetLabelForCommandId(int command_id) const;
40 // Gets the icon for the item with the specified id, returning true if there
41 // is an icon, false otherwise.
42 virtual bool GetIconForCommandId(int command_id, SkBitmap* icon) const;
40 43
41 // Notifies the delegate that the item with the specified command id was 44 // Notifies the delegate that the item with the specified command id was
42 // visually highlighted within the menu. 45 // visually highlighted within the menu.
43 virtual void CommandIdHighlighted(int command_id); 46 virtual void CommandIdHighlighted(int command_id);
44 47
45 // Performs the action associated with the specified command id. 48 // Performs the action associated with the specified command id.
46 virtual void ExecuteCommand(int command_id) = 0; 49 virtual void ExecuteCommand(int command_id) = 0;
47 50
48 protected: 51 protected:
49 virtual ~Delegate() {} 52 virtual ~Delegate() {}
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // Returns the index of the item that has the given |command_id|. Returns 96 // Returns the index of the item that has the given |command_id|. Returns
94 // -1 if not found. 97 // -1 if not found.
95 int GetIndexOfCommandId(int command_id); 98 int GetIndexOfCommandId(int command_id);
96 99
97 // Overridden from MenuModel: 100 // Overridden from MenuModel:
98 virtual bool HasIcons() const; 101 virtual bool HasIcons() const;
99 virtual int GetItemCount() const; 102 virtual int GetItemCount() const;
100 virtual ItemType GetTypeAt(int index) const; 103 virtual ItemType GetTypeAt(int index) const;
101 virtual int GetCommandIdAt(int index) const; 104 virtual int GetCommandIdAt(int index) const;
102 virtual string16 GetLabelAt(int index) const; 105 virtual string16 GetLabelAt(int index) const;
103 virtual bool IsLabelDynamicAt(int index) const; 106 virtual bool IsItemDynamicAt(int index) const;
104 virtual bool GetAcceleratorAt(int index, 107 virtual bool GetAcceleratorAt(int index,
105 menus::Accelerator* accelerator) const; 108 menus::Accelerator* accelerator) const;
106 virtual bool IsItemCheckedAt(int index) const; 109 virtual bool IsItemCheckedAt(int index) const;
107 virtual int GetGroupIdAt(int index) const; 110 virtual int GetGroupIdAt(int index) const;
108 virtual bool GetIconAt(int index, SkBitmap* icon) const; 111 virtual bool GetIconAt(int index, SkBitmap* icon) const;
109 virtual menus::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const; 112 virtual menus::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const;
110 virtual bool IsEnabledAt(int index) const; 113 virtual bool IsEnabledAt(int index) const;
111 virtual bool IsVisibleAt(int index) const; 114 virtual bool IsVisibleAt(int index) const;
112 virtual void HighlightChangedTo(int index); 115 virtual void HighlightChangedTo(int index);
113 virtual void ActivatedAt(int index); 116 virtual void ActivatedAt(int index);
(...skipping 19 matching lines...) Expand all
133 void ValidateItem(const Item& item); 136 void ValidateItem(const Item& item);
134 137
135 Delegate* delegate_; 138 Delegate* delegate_;
136 139
137 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel); 140 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel);
138 }; 141 };
139 142
140 } // namespace menus 143 } // namespace menus
141 144
142 #endif // APP_MENUS_SIMPLE_MENU_MODEL_H_ 145 #endif // APP_MENUS_SIMPLE_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « app/menus/menu_model.h ('k') | app/menus/simple_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698