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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // Notification the menu has closed. This is only sent when running the | 206 // Notification the menu has closed. This is only sent when running the |
207 // menu for a drop. | 207 // menu for a drop. |
208 virtual void DropMenuClosed(MenuItemView* menu) { | 208 virtual void DropMenuClosed(MenuItemView* menu) { |
209 } | 209 } |
210 | 210 |
211 // Returns true if the menu should close upon a drag completing. Defaults to | 211 // Returns true if the menu should close upon a drag completing. Defaults to |
212 // true. This is only invoked for drag and drop operations performed on child | 212 // true. This is only invoked for drag and drop operations performed on child |
213 // Views that are not MenuItemViews. | 213 // Views that are not MenuItemViews. |
214 virtual bool ShouldCloseOnDragComplete(); | 214 virtual bool ShouldCloseOnDragComplete(); |
215 | 215 |
| 216 // Returns true if a subview is performing a drag and drop operation, and the |
| 217 // menu shouldn't be closed. |
| 218 virtual bool InNestedDrag(); |
| 219 |
216 // Notification that the user has highlighted the specified item. | 220 // Notification that the user has highlighted the specified item. |
217 virtual void SelectionChanged(MenuItemView* menu) { | 221 virtual void SelectionChanged(MenuItemView* menu) { |
218 } | 222 } |
219 | 223 |
220 // If the user drags the mouse outside the bounds of the menu the delegate | 224 // If the user drags the mouse outside the bounds of the menu the delegate |
221 // is queried for a sibling menu to show. If this returns non-null the | 225 // is queried for a sibling menu to show. If this returns non-null the |
222 // current menu is hidden, and the menu returned from this method is shown. | 226 // current menu is hidden, and the menu returned from this method is shown. |
223 // | 227 // |
224 // The delegate owns the returned menu, not the controller. | 228 // The delegate owns the returned menu, not the controller. |
225 virtual MenuItemView* GetSiblingMenu(MenuItemView* menu, | 229 virtual MenuItemView* GetSiblingMenu(MenuItemView* menu, |
(...skipping 20 matching lines...) Expand all Loading... |
246 int* left_margin, | 250 int* left_margin, |
247 int* right_margin) const; | 251 int* right_margin) const; |
248 // Returns true if the labels should reserve additional spacing for e.g. | 252 // Returns true if the labels should reserve additional spacing for e.g. |
249 // submenu indicators at the end of the line. | 253 // submenu indicators at the end of the line. |
250 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; | 254 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; |
251 }; | 255 }; |
252 | 256 |
253 } // namespace views | 257 } // namespace views |
254 | 258 |
255 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 259 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
OLD | NEW |