| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 // Invoked to determine the drag operations for a drag session of sender. | 202 // Invoked to determine the drag operations for a drag session of sender. |
| 203 // See DragDropTypes for possible values. | 203 // See DragDropTypes for possible values. |
| 204 virtual int GetDragOperations(MenuItemView* sender); | 204 virtual int GetDragOperations(MenuItemView* sender); |
| 205 | 205 |
| 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 |
| 212 // true. This is only invoked for drag and drop operations performed on child |
| 213 // Views that are not MenuItemViews. |
| 214 virtual bool ShouldCloseOnDragComplete(); |
| 215 |
| 211 // Notification that the user has highlighted the specified item. | 216 // Notification that the user has highlighted the specified item. |
| 212 virtual void SelectionChanged(MenuItemView* menu) { | 217 virtual void SelectionChanged(MenuItemView* menu) { |
| 213 } | 218 } |
| 214 | 219 |
| 215 // If the user drags the mouse outside the bounds of the menu the delegate | 220 // If the user drags the mouse outside the bounds of the menu the delegate |
| 216 // is queried for a sibling menu to show. If this returns non-null the | 221 // is queried for a sibling menu to show. If this returns non-null the |
| 217 // current menu is hidden, and the menu returned from this method is shown. | 222 // current menu is hidden, and the menu returned from this method is shown. |
| 218 // | 223 // |
| 219 // The delegate owns the returned menu, not the controller. | 224 // The delegate owns the returned menu, not the controller. |
| 220 virtual MenuItemView* GetSiblingMenu(MenuItemView* menu, | 225 virtual MenuItemView* GetSiblingMenu(MenuItemView* menu, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 241 int* left_margin, | 246 int* left_margin, |
| 242 int* right_margin) const; | 247 int* right_margin) const; |
| 243 // Returns true if the labels should reserve additional spacing for e.g. | 248 // Returns true if the labels should reserve additional spacing for e.g. |
| 244 // submenu indicators at the end of the line. | 249 // submenu indicators at the end of the line. |
| 245 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; | 250 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; |
| 246 }; | 251 }; |
| 247 | 252 |
| 248 } // namespace views | 253 } // namespace views |
| 249 | 254 |
| 250 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 255 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
| OLD | NEW |