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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 bool is_hovered, | 96 bool is_hovered, |
97 SkColor* override_color) const; | 97 SkColor* override_color) const; |
98 | 98 |
99 // The tooltip shown for the menu item. This is invoked when the user | 99 // The tooltip shown for the menu item. This is invoked when the user |
100 // hovers over the item, and no tooltip text has been set for that item. | 100 // hovers over the item, and no tooltip text has been set for that item. |
101 virtual base::string16 GetTooltipText(int id, | 101 virtual base::string16 GetTooltipText(int id, |
102 const gfx::Point& screen_loc) const; | 102 const gfx::Point& screen_loc) const; |
103 | 103 |
104 // If there is an accelerator for the menu item with id |id| it is set in | 104 // If there is an accelerator for the menu item with id |id| it is set in |
105 // |accelerator| and true is returned. | 105 // |accelerator| and true is returned. |
106 virtual bool GetAccelerator(int id, ui::Accelerator* accelerator); | 106 virtual bool GetAccelerator(int id, ui::Accelerator* accelerator) const; |
107 | 107 |
108 // Shows the context menu with the specified id. This is invoked when the | 108 // Shows the context menu with the specified id. This is invoked when the |
109 // user does the appropriate gesture to show a context menu. The id | 109 // user does the appropriate gesture to show a context menu. The id |
110 // identifies the id of the menu to show the context menu for. | 110 // identifies the id of the menu to show the context menu for. |
111 // is_mouse_gesture is true if this is the result of a mouse gesture. | 111 // is_mouse_gesture is true if this is the result of a mouse gesture. |
112 // If this is not the result of a mouse gesture |p| is the recommended | 112 // If this is not the result of a mouse gesture |p| is the recommended |
113 // location to display the content menu at. In either case, |p| is in | 113 // location to display the content menu at. In either case, |p| is in |
114 // screen coordinates. | 114 // screen coordinates. |
115 // Returns true if a context menu was displayed, otherwise false | 115 // Returns true if a context menu was displayed, otherwise false |
116 virtual bool ShowContextMenu(MenuItemView* source, | 116 virtual bool ShowContextMenu(MenuItemView* source, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 int* left_margin, | 241 int* left_margin, |
242 int* right_margin) const; | 242 int* right_margin) const; |
243 // Returns true if the labels should reserve additional spacing for e.g. | 243 // Returns true if the labels should reserve additional spacing for e.g. |
244 // submenu indicators at the end of the line. | 244 // submenu indicators at the end of the line. |
245 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; | 245 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; |
246 }; | 246 }; |
247 | 247 |
248 } // namespace views | 248 } // namespace views |
249 | 249 |
250 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 250 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
OLD | NEW |