| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // user does the appropriate gesture to show a context menu. The id | 92 // user does the appropriate gesture to show a context menu. The id |
| 93 // identifies the id of the menu to show the context menu for. | 93 // identifies the id of the menu to show the context menu for. |
| 94 // is_mouse_gesture is true if this is the result of a mouse gesture. | 94 // is_mouse_gesture is true if this is the result of a mouse gesture. |
| 95 // If this is not the result of a mouse gesture |p| is the recommended | 95 // If this is not the result of a mouse gesture |p| is the recommended |
| 96 // location to display the content menu at. In either case, |p| is in | 96 // location to display the content menu at. In either case, |p| is in |
| 97 // screen coordinates. | 97 // screen coordinates. |
| 98 // Returns true if a context menu was displayed, otherwise false | 98 // Returns true if a context menu was displayed, otherwise false |
| 99 virtual bool ShowContextMenu(MenuItemView* source, | 99 virtual bool ShowContextMenu(MenuItemView* source, |
| 100 int id, | 100 int id, |
| 101 const gfx::Point& p, | 101 const gfx::Point& p, |
| 102 bool is_mouse_gesture); | 102 ui::MenuSourceType source_type); |
| 103 | 103 |
| 104 // Controller | 104 // Controller |
| 105 virtual bool SupportsCommand(int id) const; | 105 virtual bool SupportsCommand(int id) const; |
| 106 virtual bool IsCommandEnabled(int id) const; | 106 virtual bool IsCommandEnabled(int id) const; |
| 107 virtual bool GetContextualLabel(int id, string16* out) const; | 107 virtual bool GetContextualLabel(int id, string16* out) const; |
| 108 virtual void ExecuteCommand(int id) { | 108 virtual void ExecuteCommand(int id) { |
| 109 } | 109 } |
| 110 | 110 |
| 111 // If nested menus are showing (nested menus occur when a menu shows a context | 111 // If nested menus are showing (nested menus occur when a menu shows a context |
| 112 // menu) this is invoked to determine if all the menus should be closed when | 112 // menu) this is invoked to determine if all the menus should be closed when |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 int* left_margin, | 224 int* left_margin, |
| 225 int* right_margin) const; | 225 int* right_margin) const; |
| 226 // Returns true if the labels should reserve additional spacing for e.g. | 226 // Returns true if the labels should reserve additional spacing for e.g. |
| 227 // submenu indicators at the end of the line. | 227 // submenu indicators at the end of the line. |
| 228 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; | 228 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; |
| 229 }; | 229 }; |
| 230 | 230 |
| 231 } // namespace views | 231 } // namespace views |
| 232 | 232 |
| 233 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 233 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
| OLD | NEW |