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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 virtual bool ShouldCloseAllMenusOnExecute(int id); | 108 virtual bool ShouldCloseAllMenusOnExecute(int id); |
109 | 109 |
110 // Executes the specified command. mouse_event_flags give the flags of the | 110 // Executes the specified command. mouse_event_flags give the flags of the |
111 // mouse event that triggered this to be invoked (views::MouseEvent | 111 // mouse event that triggered this to be invoked (views::MouseEvent |
112 // flags). mouse_event_flags is 0 if this is triggered by a user gesture | 112 // flags). mouse_event_flags is 0 if this is triggered by a user gesture |
113 // other than a mouse event. | 113 // other than a mouse event. |
114 virtual void ExecuteCommand(int id, int mouse_event_flags); | 114 virtual void ExecuteCommand(int id, int mouse_event_flags); |
115 | 115 |
116 // Returns true if the specified event is one the user can use to trigger, or | 116 // Returns true if the specified event is one the user can use to trigger, or |
117 // accept, the item. Defaults to left or right mouse buttons or tap. | 117 // accept, the item. Defaults to left or right mouse buttons or tap. |
118 virtual bool IsTriggerableEvent(MenuItemView* view, const Event& e); | 118 virtual bool IsTriggerableEvent(MenuItemView* view, const ui::Event& e); |
119 | 119 |
120 // Invoked to determine if drops can be accepted for a submenu. This is | 120 // Invoked to determine if drops can be accepted for a submenu. This is |
121 // ONLY invoked for menus that have submenus and indicates whether or not | 121 // ONLY invoked for menus that have submenus and indicates whether or not |
122 // a drop can occur on any of the child items of the item. For example, | 122 // a drop can occur on any of the child items of the item. For example, |
123 // consider the following menu structure: | 123 // consider the following menu structure: |
124 // | 124 // |
125 // A | 125 // A |
126 // B | 126 // B |
127 // C | 127 // C |
128 // | 128 // |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 virtual Border* CreateMenuBorder(); | 207 virtual Border* CreateMenuBorder(); |
208 | 208 |
209 // Creates and returns a new background for the menu, or NULL if no | 209 // Creates and returns a new background for the menu, or NULL if no |
210 // background is needed. Caller owns the returned object. | 210 // background is needed. Caller owns the returned object. |
211 virtual Background* CreateMenuBackground(); | 211 virtual Background* CreateMenuBackground(); |
212 }; | 212 }; |
213 | 213 |
214 } // namespace views | 214 } // namespace views |
215 | 215 |
216 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 216 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
OLD | NEW |