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

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

Issue 7066034: Fixes couple of issues with bookmarks in wrench menu: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
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 a914f4020a22bf0c9cfbe10ff6be8aef88f93998..1978951e8d3972ef9bbbe7248e3e4341168c3b44 100644
--- a/views/controls/menu/menu_item_view.cc
+++ b/views/controls/menu/menu_item_view.cc
@@ -37,10 +37,10 @@ class EmptyMenuMenuItem : public MenuItemView {
public:
explicit EmptyMenuMenuItem(MenuItemView* parent)
: MenuItemView(parent, 0, NORMAL) {
- SetTitle(UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_APP_MENU_EMPTY_SUBMENU)));
// Set this so that we're not identified as a normal menu item.
SetID(kEmptyMenuItemViewID);
+ SetTitle(UTF16ToWide(
+ l10n_util::GetStringUTF16(IDS_APP_MENU_EMPTY_SUBMENU)));
SetEnabled(false);
}
@@ -738,6 +738,11 @@ int MenuItemView::GetChildPreferredWidth() {
}
string16 MenuItemView::GetAcceleratorText() {
+ if (GetID() == kEmptyMenuItemViewID) {
+ // Don't query the delegate for menus that represent no children.
+ return string16();
+ }
+
Accelerator accelerator;
return (GetDelegate() &&
GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ?

Powered by Google App Engine
This is Rietveld 408576698