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

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

Issue 7825024: For Touch: remove some menu items for experimentation, adjust sizes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reverted blank line suppression Created 9 years, 4 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_item_view.h ('k') | views/controls/menu/menu_item_view_linux.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.cc
diff --git a/views/controls/menu/menu_item_view.cc b/views/controls/menu/menu_item_view.cc
index 8181793a74561dd8a3d119d2b8fd20e612ec04fb..167a2cc7e6b4df2fdaa9c44601966d5d651d5bb1 100644
--- a/views/controls/menu/menu_item_view.cc
+++ b/views/controls/menu/menu_item_view.cc
@@ -87,6 +87,11 @@ MenuItemView::MenuItemView(MenuDelegate* delegate)
has_mnemonics_(false),
show_mnemonics_(false),
has_icons_(false),
+#ifdef TOUCH_UI
sky 2011/09/02 22:30:10 This should be in MenuConfig, which is the central
Emmanuel Saint-loubert-Bié 2011/09/02 23:04:37 Thanks, I did not know/realize that.
+ show_accelerators_(false),
+#else
+ show_accelerators_(true),
+#endif
top_margin_(-1),
bottom_margin_(-1),
requested_menu_position_(POSITION_BEST_FIT),
@@ -684,8 +689,9 @@ gfx::Size MenuItemView::GetChildPreferredSize() {
}
string16 MenuItemView::GetAcceleratorText() {
- if (id() == kEmptyMenuItemViewID) {
- // Don't query the delegate for menus that represent no children.
+ if (id() == kEmptyMenuItemViewID || !show_accelerators_) {
+ // Don't query the delegate for menus that represent no children, or
+ // when accelerators are not shown return an empty string.
return string16();
}
« no previous file with comments | « views/controls/menu/menu_item_view.h ('k') | views/controls/menu/menu_item_view_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698