| 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 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "ui/base/dragdrop/drag_drop_types.h" | 13 #include "ui/base/dragdrop/drag_drop_types.h" |
| 14 #include "ui/base/dragdrop/os_exchange_data.h" | 14 #include "ui/base/dragdrop/os_exchange_data.h" |
| 15 #include "ui/views/controls/menu/menu_item_view.h" | 15 #include "ui/views/controls/menu/menu_item_view.h" |
| 16 | 16 |
| 17 using ui::OSExchangeData; | 17 using ui::OSExchangeData; |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 class Font; | 20 class FontList; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 class Accelerator; | 24 class Accelerator; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace views { | 27 namespace views { |
| 28 | 28 |
| 29 class MenuButton; | 29 class MenuButton; |
| 30 | 30 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 57 | 57 |
| 58 // Whether or not an item should be shown as checked. This is invoked for | 58 // Whether or not an item should be shown as checked. This is invoked for |
| 59 // radio buttons and check buttons. | 59 // radio buttons and check buttons. |
| 60 virtual bool IsItemChecked(int id) const; | 60 virtual bool IsItemChecked(int id) const; |
| 61 | 61 |
| 62 // The string shown for the menu item. This is only invoked when an item is | 62 // The string shown for the menu item. This is only invoked when an item is |
| 63 // added with an empty label. | 63 // added with an empty label. |
| 64 virtual base::string16 GetLabel(int id) const; | 64 virtual base::string16 GetLabel(int id) const; |
| 65 | 65 |
| 66 // The font for the menu item label. | 66 // The font for the menu item label. |
| 67 virtual const gfx::Font* GetLabelFont(int id) const; | 67 virtual const gfx::FontList* GetLabelFontList(int id) const; |
| 68 | 68 |
| 69 // Override the text color of a given menu item dependent on the | 69 // Override the text color of a given menu item dependent on the |
| 70 // |command_id| and its |is_hovered| state. Returns true if it chooses to | 70 // |command_id| and its |is_hovered| state. Returns true if it chooses to |
| 71 // override the color. | 71 // override the color. |
| 72 virtual bool GetForegroundColor(int command_id, | 72 virtual bool GetForegroundColor(int command_id, |
| 73 bool is_hovered, | 73 bool is_hovered, |
| 74 SkColor* override_color) const; | 74 SkColor* override_color) const; |
| 75 | 75 |
| 76 // Override the background color of a given menu item dependent on the | 76 // Override the background color of a given menu item dependent on the |
| 77 // |command_id| and its |is_hovered| state. Returns true if it chooses to | 77 // |command_id| and its |is_hovered| state. Returns true if it chooses to |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 int* left_margin, | 225 int* left_margin, |
| 226 int* right_margin) const; | 226 int* right_margin) const; |
| 227 // Returns true if the labels should reserve additional spacing for e.g. | 227 // Returns true if the labels should reserve additional spacing for e.g. |
| 228 // submenu indicators at the end of the line. | 228 // submenu indicators at the end of the line. |
| 229 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; | 229 virtual bool ShouldReserveSpaceForSubmenuIndicator() const; |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 } // namespace views | 232 } // namespace views |
| 233 | 233 |
| 234 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ | 234 #endif // UI_VIEWS_CONTROLS_MENU_MENU_DELEGATE_H_ |
| OLD | NEW |