Chromium Code Reviews| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 // radio buttons and check buttons. | 64 // radio buttons and check buttons. |
| 65 virtual bool IsItemChecked(int id) const; | 65 virtual bool IsItemChecked(int id) const; |
| 66 | 66 |
| 67 // The string shown for the menu item. This is only invoked when an item is | 67 // The string shown for the menu item. This is only invoked when an item is |
| 68 // added with an empty label. | 68 // added with an empty label. |
| 69 virtual string16 GetLabel(int id) const; | 69 virtual string16 GetLabel(int id) const; |
| 70 | 70 |
| 71 // The font for the menu item label. | 71 // The font for the menu item label. |
| 72 virtual const gfx::Font* GetLabelFont(int id) const; | 72 virtual const gfx::Font* GetLabelFont(int id) const; |
| 73 | 73 |
| 74 // Override the background color of a given menu item dependent on the | |
| 75 // |command_id| and its |is_hovered| state. Returns true if it chooses to | |
| 76 // override the color. | |
| 77 virtual bool GetBackgroundColor(int command_id, | |
| 78 bool is_hovered, | |
| 79 SkColor* override_color) const; | |
|
sky
2013/01/31 21:15:02
This shouldn't take is_hovered, instead it should
Mr4D (OOO till 08-26)
2013/01/31 22:38:52
Actually... The background colors are different fr
sky
2013/02/01 00:17:33
Ugh.
Ok, in that case the names you've gone with a
Mr4D (OOO till 08-26)
2013/02/01 15:48:28
As discussed: The names are correct. The function
| |
| 80 | |
| 74 // The tooltip shown for the menu item. This is invoked when the user | 81 // The tooltip shown for the menu item. This is invoked when the user |
| 75 // hovers over the item, and no tooltip text has been set for that item. | 82 // hovers over the item, and no tooltip text has been set for that item. |
| 76 virtual string16 GetTooltipText(int id, const gfx::Point& screen_loc) const; | 83 virtual string16 GetTooltipText(int id, const gfx::Point& screen_loc) const; |
| 77 | 84 |
| 78 // If there is an accelerator for the menu item with id |id| it is set in | 85 // If there is an accelerator for the menu item with id |id| it is set in |
| 79 // |accelerator| and true is returned. | 86 // |accelerator| and true is returned. |
| 80 virtual bool GetAccelerator(int id, ui::Accelerator* accelerator); | 87 virtual bool GetAccelerator(int id, ui::Accelerator* accelerator); |
| 81 | 88 |
| 82 // Shows the context menu with the specified id. This is invoked when the | 89 // Shows the context menu with the specified id. This is invoked when the |
| 83 // user does the appropriate gesture to show a context menu. The id | 90 // user does the appropriate gesture to show a context menu. The id |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 // and |right_margin| accordingly. Note: Negative values can be returned. | 219 // and |right_margin| accordingly. Note: Negative values can be returned. |
| 213 virtual void GetHorizontalIconMargins(int command_id, | 220 virtual void GetHorizontalIconMargins(int command_id, |
| 214 int icon_size, | 221 int icon_size, |
| 215 int* left_margin, | 222 int* left_margin, |
| 216 int* right_margin) const; | 223 int* right_margin) const; |
| 217 }; | 224 }; |
| 218 | 225 |
| 219 } // namespace views | 226 } // namespace views |
| 220 | 227 |
| 221 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 228 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
| OLD | NEW |