summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 19:27:46 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 19:27:46 +0000
commitd4c4f252a9422a4001e31dc811400382d5a93a93 (patch)
tree021fc6d69bed5a9d54e508083ab1b696dd91d913 /views
parentfbe02d647538479cc11a5503f9fdbc27cf3c5c60 (diff)
downloadchromium_src-d4c4f252a9422a4001e31dc811400382d5a93a93.zip
chromium_src-d4c4f252a9422a4001e31dc811400382d5a93a93.tar.gz
chromium_src-d4c4f252a9422a4001e31dc811400382d5a93a93.tar.bz2
Adds support for invisible menu items to bookmark menus and wires it
up for the wrench menu. BUG=46221, 54017 TEST=see bug Review URL: http://codereview.chromium.org/3289001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/menu/submenu_view.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/views/controls/menu/submenu_view.cc b/views/controls/menu/submenu_view.cc
index a6e48d5..0df12e5 100644
--- a/views/controls/menu/submenu_view.cc
+++ b/views/controls/menu/submenu_view.cc
@@ -86,9 +86,11 @@ void SubmenuView::Layout() {
int menu_item_width = width() - insets.width();
for (int i = 0; i < GetChildViewCount(); ++i) {
View* child = GetChildViewAt(i);
- gfx::Size child_pref_size = child->GetPreferredSize();
- child->SetBounds(x, y, menu_item_width, child_pref_size.height());
- y += child_pref_size.height();
+ if (child->IsVisible()) {
+ gfx::Size child_pref_size = child->GetPreferredSize();
+ child->SetBounds(x, y, menu_item_width, child_pref_size.height());
+ y += child_pref_size.height();
+ }
}
}
@@ -101,7 +103,8 @@ gfx::Size SubmenuView::GetPreferredSize() {
int height = 0;
for (int i = 0; i < GetChildViewCount(); ++i) {
View* child = GetChildViewAt(i);
- gfx::Size child_pref_size = child->GetPreferredSize();
+ gfx::Size child_pref_size = child->IsVisible() ?
+ child->GetPreferredSize() : gfx::Size();
max_width = std::max(max_width, child_pref_size.width());
height += child_pref_size.height();
if (child->GetID() == MenuItemView::kMenuItemViewID) {