diff options
Diffstat (limited to 'views/controls/menu/menu_item_view.h')
-rw-r--r-- | views/controls/menu/menu_item_view.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/views/controls/menu/menu_item_view.h b/views/controls/menu/menu_item_view.h index 936ff1e..6caa09a 100644 --- a/views/controls/menu/menu_item_view.h +++ b/views/controls/menu/menu_item_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -71,6 +71,9 @@ class MenuItemView : public View { virtual ~MenuItemView(); + // Overridden from View: + virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); + // Returns the preferred height of menu items. This is only valid when the // menu is about to be shown. static int pref_menu_height() { return pref_menu_height_; } @@ -178,6 +181,9 @@ class MenuItemView : public View { // Returns true if the item is selected. bool IsSelected() const { return selected_; } + // Sets the |tooltip| for a menu item view with |item_id| identifier. + void SetTooltip(const std::wstring& tooltip, int item_id); + // Sets the icon for the descendant identified by item_id. void SetIcon(const SkBitmap& icon, int item_id); @@ -321,6 +327,9 @@ class MenuItemView : public View { bool has_icons_; + // The tooltip to show on hover for this menu item. + std::wstring tooltip_; + // X-coordinate of where the label starts. static int label_start_; |