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

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

Issue 650074: New network menu button UI for ChromeOS.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months 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 | « no previous file | app/resource_bundle.h » ('j') | views/controls/menu/native_menu_gtk.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 7
8 #include "app/gfx/native_widget_types.h" 8 #include "app/gfx/native_widget_types.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
11 11
12 class SkBitmap; 12 class SkBitmap;
13 13
14 namespace gfx {
15
16 class Font;
17
18 } // namespace gfx
19
14 namespace menus { 20 namespace menus {
15 21
16 class Accelerator; 22 class Accelerator;
17 23
18 // An interface implemented by an object that provides the content of a menu. 24 // An interface implemented by an object that provides the content of a menu.
19 class MenuModel { 25 class MenuModel {
20 public: 26 public:
21 virtual ~MenuModel() {} 27 virtual ~MenuModel() {}
22 28
23 // The type of item. 29 // The type of item.
(...skipping 28 matching lines...) Expand all
52 virtual int GetCommandIdAt(int index) const = 0; 58 virtual int GetCommandIdAt(int index) const = 0;
53 59
54 // Returns the label of the item at the specified index. 60 // Returns the label of the item at the specified index.
55 virtual string16 GetLabelAt(int index) const = 0; 61 virtual string16 GetLabelAt(int index) const = 0;
56 62
57 // Returns true if the label at the specified index can change over the course 63 // Returns true if the label at the specified index can change over the course
58 // of the menu's lifetime. If this function returns true, the label of the 64 // of the menu's lifetime. If this function returns true, the label of the
59 // menu item will be updated each time the menu is shown. 65 // menu item will be updated each time the menu is shown.
60 virtual bool IsLabelDynamicAt(int index) const = 0; 66 virtual bool IsLabelDynamicAt(int index) const = 0;
61 67
68 // Returns the font use for the label at the specified index.
69 // If NULL, then use default font.
70 virtual const gfx::Font* GetLabelFontAt(int index) const { return NULL; }
71
62 // Gets the acclerator information for the specified index, returning true if 72 // Gets the acclerator information for the specified index, returning true if
63 // there is a shortcut accelerator for the item, false otherwise. 73 // there is a shortcut accelerator for the item, false otherwise.
64 virtual bool GetAcceleratorAt(int index, 74 virtual bool GetAcceleratorAt(int index,
65 menus::Accelerator* accelerator) const = 0; 75 menus::Accelerator* accelerator) const = 0;
66 76
67 // Returns the checked state of the item at the specified index. 77 // Returns the checked state of the item at the specified index.
68 virtual bool IsItemCheckedAt(int index) const = 0; 78 virtual bool IsItemCheckedAt(int index) const = 0;
69 79
70 // Returns the id of the group of radio items that the item at the specified 80 // Returns the id of the group of radio items that the item at the specified
71 // index belongs to. 81 // index belongs to.
(...skipping 22 matching lines...) Expand all
94 // Retrieves the model and index that contains a specific command id. Returns 104 // Retrieves the model and index that contains a specific command id. Returns
95 // true if an item with the specified command id is found. |model| is inout, 105 // true if an item with the specified command id is found. |model| is inout,
96 // and specifies the model to start searching from. 106 // and specifies the model to start searching from.
97 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, 107 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model,
98 int* index); 108 int* index);
99 }; 109 };
100 110
101 } // namespace 111 } // namespace
102 112
103 #endif // APP_MENUS_MENU_MODEL_H_ 113 #endif // APP_MENUS_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | app/resource_bundle.h » ('j') | views/controls/menu/native_menu_gtk.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698