OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_BASE_MODELS_MENU_MODEL_H_ | 5 #ifndef UI_BASE_MODELS_MENU_MODEL_H_ |
6 #define UI_BASE_MODELS_MENU_MODEL_H_ | 6 #define UI_BASE_MODELS_MENU_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 // Returns the model for the submenu at the specified index. | 101 // Returns the model for the submenu at the specified index. |
102 virtual MenuModel* GetSubmenuModelAt(int index) const = 0; | 102 virtual MenuModel* GetSubmenuModelAt(int index) const = 0; |
103 | 103 |
104 // Called when the highlighted menu item changes to the item at the specified | 104 // Called when the highlighted menu item changes to the item at the specified |
105 // index. | 105 // index. |
106 virtual void HighlightChangedTo(int index) = 0; | 106 virtual void HighlightChangedTo(int index) = 0; |
107 | 107 |
108 // Called when the item at the specified index has been activated. | 108 // Called when the item at the specified index has been activated. |
109 virtual void ActivatedAt(int index) = 0; | 109 virtual void ActivatedAt(int index) = 0; |
110 | 110 |
111 // Called when the item has been activated with a given disposition (for the | 111 // Called when the item has been activated with an event flags. |
Ben Goodger (Google)
2011/05/31 16:00:00
I would note here what flags are... is there a pla
shinyak (Google)
2011/06/09 02:29:04
Done.
| |
112 // case where the activation involves a navigation). | 112 virtual void ActivatedAtWithFlags(int index, int flags); |
113 virtual void ActivatedAtWithDisposition(int index, int disposition); | |
114 | 113 |
115 // Called when the menu is about to be shown. | 114 // Called when the menu is about to be shown. |
116 virtual void MenuWillShow() {} | 115 virtual void MenuWillShow() {} |
117 | 116 |
118 // Called when the menu has been closed. | 117 // Called when the menu has been closed. |
119 virtual void MenuClosed() {} | 118 virtual void MenuClosed() {} |
120 | 119 |
121 // Set the MenuModelDelegate. Owned by the caller of this function. | 120 // Set the MenuModelDelegate. Owned by the caller of this function. |
122 virtual void SetMenuModelDelegate(MenuModelDelegate* delegate) = 0; | 121 virtual void SetMenuModelDelegate(MenuModelDelegate* delegate) = 0; |
123 | 122 |
124 // Retrieves the model and index that contains a specific command id. Returns | 123 // Retrieves the model and index that contains a specific command id. Returns |
125 // true if an item with the specified command id is found. |model| is inout, | 124 // true if an item with the specified command id is found. |model| is inout, |
126 // and specifies the model to start searching from. | 125 // and specifies the model to start searching from. |
127 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, | 126 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, |
128 int* index); | 127 int* index); |
129 }; | 128 }; |
130 | 129 |
131 } // namespace ui | 130 } // namespace ui |
132 | 131 |
133 #endif // UI_BASE_MODELS_MENU_MODEL_H_ | 132 #endif // UI_BASE_MODELS_MENU_MODEL_H_ |
OLD | NEW |