diff options
Diffstat (limited to 'chromium/ui/views/controls/menu/menu_delegate.h')
-rw-r--r-- | chromium/ui/views/controls/menu/menu_delegate.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/chromium/ui/views/controls/menu/menu_delegate.h b/chromium/ui/views/controls/menu/menu_delegate.h index f171d570b7e..fafccd790f9 100644 --- a/chromium/ui/views/controls/menu/menu_delegate.h +++ b/chromium/ui/views/controls/menu/menu_delegate.h @@ -10,23 +10,29 @@ #include "base/logging.h" #include "base/strings/string16.h" +#include "third_party/skia/include/core/SkColor.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/os_exchange_data.h" -#include "ui/views/controls/menu/menu_item_view.h" +#include "ui/base/ui_base_types.h" +#include "ui/views/controls/menu/menu_types.h" +#include "ui/views/views_export.h" using ui::OSExchangeData; namespace gfx { -class Font; +class FontList; +class Point; } namespace ui { class Accelerator; +class DropTargetEvent; } namespace views { class MenuButton; +class MenuItemView; // MenuDelegate -------------------------------------------------------------- @@ -61,14 +67,21 @@ class VIEWS_EXPORT MenuDelegate { // The string shown for the menu item. This is only invoked when an item is // added with an empty label. - virtual string16 GetLabel(int id) const; + virtual base::string16 GetLabel(int id) const; // The font for the menu item label. - virtual const gfx::Font* GetLabelFont(int id) const; + virtual const gfx::FontList* GetLabelFontList(int id) const; + + // Whether this item should be displayed with a bolder color when disabled. + virtual bool GetShouldUseDisabledEmphasizedForegroundColor( + int command_id) const; // Override the text color of a given menu item dependent on the // |command_id| and its |is_hovered| state. Returns true if it chooses to // override the color. + // + // TODO(erg): Remove this interface. Injecting raw colors into the menu + // circumvents the NativeTheme. virtual bool GetForegroundColor(int command_id, bool is_hovered, SkColor* override_color) const; @@ -76,17 +89,21 @@ class VIEWS_EXPORT MenuDelegate { // Override the background color of a given menu item dependent on the // |command_id| and its |is_hovered| state. Returns true if it chooses to // override the color. + // + // TODO(erg): Remove this interface. Injecting raw colors into the menu + // circumvents the NativeTheme. virtual bool GetBackgroundColor(int command_id, bool is_hovered, SkColor* override_color) const; // The tooltip shown for the menu item. This is invoked when the user // hovers over the item, and no tooltip text has been set for that item. - virtual string16 GetTooltipText(int id, const gfx::Point& screen_loc) const; + virtual base::string16 GetTooltipText(int id, + const gfx::Point& screen_loc) const; // If there is an accelerator for the menu item with id |id| it is set in // |accelerator| and true is returned. - virtual bool GetAccelerator(int id, ui::Accelerator* accelerator); + virtual bool GetAccelerator(int id, ui::Accelerator* accelerator) const; // Shows the context menu with the specified id. This is invoked when the // user does the appropriate gesture to show a context menu. The id @@ -104,7 +121,8 @@ class VIEWS_EXPORT MenuDelegate { // Controller virtual bool SupportsCommand(int id) const; virtual bool IsCommandEnabled(int id) const; - virtual bool GetContextualLabel(int id, string16* out) const; + virtual bool IsCommandVisible(int id) const; + virtual bool GetContextualLabel(int id, base::string16* out) const; virtual void ExecuteCommand(int id) { } @@ -202,7 +220,7 @@ class VIEWS_EXPORT MenuDelegate { // The delegate owns the returned menu, not the controller. virtual MenuItemView* GetSiblingMenu(MenuItemView* menu, const gfx::Point& screen_point, - MenuItemView::AnchorPosition* anchor, + MenuAnchorPosition* anchor, bool* has_mnemonics, MenuButton** button); |