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

Side by Side Diff: app/menus/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/button_menu_item_model.cc ('k') | app/menus/simple_menu_model.h » ('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_MENU_MODEL_H_ 5 #ifndef APP_MENUS_MENU_MODEL_H_
6 #define APP_MENUS_MENU_MODEL_H_ 6 #define APP_MENUS_MENU_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // Returns the type of item at the specified index. 57 // Returns the type of item at the specified index.
58 virtual ItemType GetTypeAt(int index) const = 0; 58 virtual ItemType GetTypeAt(int index) const = 0;
59 59
60 // Returns the command id of the item at the specified index. 60 // Returns the command id of the item at the specified index.
61 virtual int GetCommandIdAt(int index) const = 0; 61 virtual int GetCommandIdAt(int index) const = 0;
62 62
63 // Returns the label of the item at the specified index. 63 // Returns the label of the item at the specified index.
64 virtual string16 GetLabelAt(int index) const = 0; 64 virtual string16 GetLabelAt(int index) const = 0;
65 65
66 // Returns true if the label at the specified index can change over the course 66 // Returns true if the menu item (label/icon) at the specified index can
67 // of the menu's lifetime. If this function returns true, the label of the 67 // change over the course of the menu's lifetime. If this function returns
68 // menu item will be updated each time the menu is shown. 68 // true, the label and icon of the menu item will be updated each time the
69 virtual bool IsLabelDynamicAt(int index) const = 0; 69 // menu is shown.
70 virtual bool IsItemDynamicAt(int index) const = 0;
70 71
71 // Returns the font use for the label at the specified index. 72 // Returns the font use for the label at the specified index.
72 // If NULL, then use default font. 73 // If NULL, then use default font.
73 virtual const gfx::Font* GetLabelFontAt(int index) const; 74 virtual const gfx::Font* GetLabelFontAt(int index) const;
74 75
75 // Gets the acclerator information for the specified index, returning true if 76 // Gets the acclerator information for the specified index, returning true if
76 // there is a shortcut accelerator for the item, false otherwise. 77 // there is a shortcut accelerator for the item, false otherwise.
77 virtual bool GetAcceleratorAt(int index, 78 virtual bool GetAcceleratorAt(int index,
78 menus::Accelerator* accelerator) const = 0; 79 menus::Accelerator* accelerator) const = 0;
79 80
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Retrieves the model and index that contains a specific command id. Returns 118 // Retrieves the model and index that contains a specific command id. Returns
118 // true if an item with the specified command id is found. |model| is inout, 119 // true if an item with the specified command id is found. |model| is inout,
119 // and specifies the model to start searching from. 120 // and specifies the model to start searching from.
120 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, 121 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model,
121 int* index); 122 int* index);
122 }; 123 };
123 124
124 } // namespace 125 } // namespace
125 126
126 #endif // APP_MENUS_MENU_MODEL_H_ 127 #endif // APP_MENUS_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « app/menus/button_menu_item_model.cc ('k') | app/menus/simple_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698