diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 00:08:19 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 00:08:19 +0000 |
commit | 778c0d933118eec1b9a027010051e432d6d09852 (patch) | |
tree | eaa868f55e0174d3fea22a8df0cc7d81bd2aa123 /chrome/browser/views/toolbar_view.cc | |
parent | 28b5a8494387b85fa19ca61940760e08954bcaa3 (diff) | |
download | chromium_src-778c0d933118eec1b9a027010051e432d6d09852.zip chromium_src-778c0d933118eec1b9a027010051e432d6d09852.tar.gz chromium_src-778c0d933118eec1b9a027010051e432d6d09852.tar.bz2 |
Don't allow the browser window to be resized so small that layout starts breaking horribly. When it _is_ small, draw the frame correctly.This is an incomplete fix; only non-Aero main/popup/app windows are handled so far, but this was becoming hairy enough I wanted to checkpoint it.BUG=9885
Review URL: http://codereview.chromium.org/88069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/toolbar_view.cc')
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index d5136b6..31bf7d2 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -534,12 +534,23 @@ bool BrowserToolbarView::OnKeyReleased(const views::KeyEvent& e) { gfx::Size BrowserToolbarView::GetPreferredSize() { if (IsDisplayModeNormal()) { + int min_width = kControlIndent + back_->GetPreferredSize().width() + + forward_->GetPreferredSize().width() + kControlHorizOffset + + reload_->GetPreferredSize().width() + (show_home_button_.GetValue() ? + (home_->GetPreferredSize().width() + kControlHorizOffset) : 0) + + star_->GetPreferredSize().width() + go_->GetPreferredSize().width() + + kMenuButtonOffset + + (bookmark_menu_ ? bookmark_menu_->GetPreferredSize().width() : 0) + + page_menu_->GetPreferredSize().width() + + app_menu_->GetPreferredSize().width() + kPaddingRight; + static SkBitmap normal_background; if (normal_background.isNull()) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); normal_background = *rb.GetBitmapNamed(IDR_CONTENT_TOP_CENTER); } - return gfx::Size(0, normal_background.height()); + + return gfx::Size(min_width, normal_background.height()); } int vertical_spacing = PopupTopSpacing() + |