OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 virtual void ExecuteCommand(int id) { | 125 virtual void ExecuteCommand(int id) { |
126 } | 126 } |
127 | 127 |
128 // If nested menus are showing (nested menus occur when a menu shows a context | 128 // If nested menus are showing (nested menus occur when a menu shows a context |
129 // menu) this is invoked to determine if all the menus should be closed when | 129 // menu) this is invoked to determine if all the menus should be closed when |
130 // the user selects the menu with the command |id|. This returns true to | 130 // the user selects the menu with the command |id|. This returns true to |
131 // indicate that all menus should be closed. Return false if only the | 131 // indicate that all menus should be closed. Return false if only the |
132 // context menu should be closed. | 132 // context menu should be closed. |
133 virtual bool ShouldCloseAllMenusOnExecute(int id); | 133 virtual bool ShouldCloseAllMenusOnExecute(int id); |
134 | 134 |
135 // Returns true if the menu should close upon a drag completing. Defaults to | |
136 // true. | |
sky
2014/07/14 15:19:05
Document this is only invoked for menus originatin
Devlin
2014/07/16 16:00:45
Done.
| |
137 virtual bool ShouldCloseOnDragComplete(); | |
138 | |
135 // Executes the specified command. mouse_event_flags give the flags of the | 139 // Executes the specified command. mouse_event_flags give the flags of the |
136 // mouse event that triggered this to be invoked (ui::MouseEvent | 140 // mouse event that triggered this to be invoked (ui::MouseEvent |
137 // flags). mouse_event_flags is 0 if this is triggered by a user gesture | 141 // flags). mouse_event_flags is 0 if this is triggered by a user gesture |
138 // other than a mouse event. | 142 // other than a mouse event. |
139 virtual void ExecuteCommand(int id, int mouse_event_flags); | 143 virtual void ExecuteCommand(int id, int mouse_event_flags); |
140 | 144 |
141 // Returns true if ExecuteCommand() should be invoked while leaving the | 145 // Returns true if ExecuteCommand() should be invoked while leaving the |
142 // menu open. Default implementation returns true. | 146 // menu open. Default implementation returns true. |
143 virtual bool ShouldExecuteCommandWithoutClosingMenu(int id, | 147 virtual bool ShouldExecuteCommandWithoutClosingMenu(int id, |
144 const ui::Event& e); | 148 const ui::Event& e); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 int* left_margin, | 245 int* left_margin, |
242 int* right_margin) const; | 246 int* right_margin) const; |
243 // Returns true if the labels should reserve additional spacing for e.g. | 247 // Returns true if the labels should reserve additional spacing for e.g. |
244 // submenu indicators at the end of the line. | 248 // submenu indicators at the end of the line. |
245 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; | 249 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; |
246 }; | 250 }; |
247 | 251 |
248 } // namespace views | 252 } // namespace views |
249 | 253 |
250 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 254 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
OLD | NEW |