Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: views/controls/menu/menu_item_view.h

Issue 2742003: Adds support for showing accelerators in bookmark menus. (Closed)
Patch Set: Added GetAcceleratorText Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/menu/menu_delegate.h ('k') | views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_item_view.h
diff --git a/views/controls/menu/menu_item_view.h b/views/controls/menu/menu_item_view.h
index c04c34181bef0d506453dab1e0a200bc16237d61..69d850eea91d712205b637496f903f28eb39ebe4 100644
--- a/views/controls/menu/menu_item_view.h
+++ b/views/controls/menu/menu_item_view.h
@@ -246,6 +246,10 @@ class MenuItemView : public View {
// Sizes any child views.
virtual void Layout();
+ // Returns the amount of space needed to accomodate the accelerator. The
+ // space needed for the accelerator is NOT included in the preferred width.
+ int GetAcceleratorTextWidth();
+
protected:
// Creates a MenuItemView. This is used by the various AddXXX methods.
MenuItemView(MenuItemView* parent, int command, Type type);
@@ -289,10 +293,16 @@ class MenuItemView : public View {
// are not rendered.
void Paint(gfx::Canvas* canvas, bool for_drag);
+ // Paints the accelerator.
+ void PaintAccelerator(gfx::Canvas* canvas);
+
// Destroys the window used to display this menu and recursively destroys
// the windows used to display all descendants.
void DestroyAllMenuHosts();
+ // Returns the accelerator text.
+ std::wstring GetAcceleratorText();
+
// Returns the various margins.
int GetTopMargin();
int GetBottomMargin();
« no previous file with comments | « views/controls/menu/menu_delegate.h ('k') | views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698