summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 23:02:35 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 23:02:35 +0000
commite37397a176eac68e8b18b2708e4ee41e131af0bf (patch)
tree830f73f10c93153320c2bb1ffda29bc36bdbe723 /views
parent3766238379caee23c192b3d1896f3cc76e0d86b4 (diff)
downloadchromium_src-e37397a176eac68e8b18b2708e4ee41e131af0bf.zip
chromium_src-e37397a176eac68e8b18b2708e4ee41e131af0bf.tar.gz
chromium_src-e37397a176eac68e8b18b2708e4ee41e131af0bf.tar.bz2
Changes the max width for bookmark menus back to 400 and leaves them
at 800 for the wrench menu. Apparently folks don't like wide bookmark menus. BUG=50653 TEST=see bug Review URL: http://codereview.chromium.org/3317011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58771 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/menu/menu_controller.cc12
-rw-r--r--views/controls/menu/menu_delegate.h7
2 files changed, 10 insertions, 9 deletions
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index c3b111d..9b4a0b3 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -38,12 +38,6 @@ static const int kShowDelay = 400;
// Amount of time from when the drop exits the menu and the menu is hidden.
static const int kCloseOnExitTime = 1200;
-// Max width of a menu. There does not appear to be an OS value for this, yet
-// both IE and FF restrict the max width of a menu.
-// NOTE: this needs to be large enough to accommodate the wrench menu with big
-// fonts.
-static const int kMaxMenuWidth = 800;
-
// Amount to inset submenus.
static const int kSubmenuHorizontalInset = 3;
@@ -1403,9 +1397,9 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
gfx::Size pref = submenu->GetScrollViewContainer()->GetPreferredSize();
- // Don't let the menu go to wide. This is some where between what IE and FF
- // do.
- pref.set_width(std::min(pref.width(), kMaxMenuWidth));
+ // Don't let the menu go to wide.
+ pref.set_width(std::min(pref.width(),
+ item->GetDelegate()->GetMaxWidthForMenu()));
if (!state_.monitor_bounds.IsEmpty())
pref.set_width(std::min(pref.width(), state_.monitor_bounds.width()));
diff --git a/views/controls/menu/menu_delegate.h b/views/controls/menu/menu_delegate.h
index 7ddc556..8186a28 100644
--- a/views/controls/menu/menu_delegate.h
+++ b/views/controls/menu/menu_delegate.h
@@ -209,6 +209,13 @@ class MenuDelegate : Controller {
MenuButton** button) {
return NULL;
}
+
+ // Returns the max width menus can grow to be.
+ virtual int GetMaxWidthForMenu() {
+ // NOTE: this needs to be large enough to accommodate the wrench menu with
+ // big fonts.
+ return 800;
+ }
};
} // namespace views