Chromium Code Reviews| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 // indicate that all menus should be closed. Return false if only the | 105 // indicate that all menus should be closed. Return false if only the |
| 106 // context menu should be closed. | 106 // context menu should be closed. |
| 107 virtual bool ShouldCloseAllMenusOnExecute(int id); | 107 virtual bool ShouldCloseAllMenusOnExecute(int id); |
| 108 | 108 |
| 109 // Executes the specified command. mouse_event_flags give the flags of the | 109 // Executes the specified command. mouse_event_flags give the flags of the |
| 110 // mouse event that triggered this to be invoked (ui::MouseEvent | 110 // mouse event that triggered this to be invoked (ui::MouseEvent |
| 111 // flags). mouse_event_flags is 0 if this is triggered by a user gesture | 111 // flags). mouse_event_flags is 0 if this is triggered by a user gesture |
| 112 // other than a mouse event. | 112 // other than a mouse event. |
| 113 virtual void ExecuteCommand(int id, int mouse_event_flags); | 113 virtual void ExecuteCommand(int id, int mouse_event_flags); |
| 114 | 114 |
| 115 // Returns true if command specified by |id| should execute on event |e| | |
|
sky
2012/12/11 15:59:43
Returns true if ExecuteCommand() should be invoked
yosin_UTC9
2012/12/12 01:39:39
Done.
| |
| 116 // without closingmenu. | |
| 117 virtual bool ShouldExecuteCommandWithoutClosingMenu(int id, | |
| 118 const ui::Event& e); | |
| 119 | |
| 115 // Returns true if the specified event is one the user can use to trigger, or | 120 // Returns true if the specified event is one the user can use to trigger, or |
| 116 // accept, the item. Defaults to left or right mouse buttons or tap. | 121 // accept, the item. Defaults to left or right mouse buttons or tap. |
| 117 virtual bool IsTriggerableEvent(MenuItemView* view, const ui::Event& e); | 122 virtual bool IsTriggerableEvent(MenuItemView* view, const ui::Event& e); |
| 118 | 123 |
| 119 // Invoked to determine if drops can be accepted for a submenu. This is | 124 // Invoked to determine if drops can be accepted for a submenu. This is |
| 120 // ONLY invoked for menus that have submenus and indicates whether or not | 125 // ONLY invoked for menus that have submenus and indicates whether or not |
| 121 // a drop can occur on any of the child items of the item. For example, | 126 // a drop can occur on any of the child items of the item. For example, |
| 122 // consider the following menu structure: | 127 // consider the following menu structure: |
| 123 // | 128 // |
| 124 // A | 129 // A |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 // Invoked prior to a menu being shown. | 203 // Invoked prior to a menu being shown. |
| 199 virtual void WillShowMenu(MenuItemView* menu); | 204 virtual void WillShowMenu(MenuItemView* menu); |
| 200 | 205 |
| 201 // Invoked prior to a menu being hidden. | 206 // Invoked prior to a menu being hidden. |
| 202 virtual void WillHideMenu(MenuItemView* menu); | 207 virtual void WillHideMenu(MenuItemView* menu); |
| 203 }; | 208 }; |
| 204 | 209 |
| 205 } // namespace views | 210 } // namespace views |
| 206 | 211 |
| 207 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 212 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
| OLD | NEW |