diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 17:24:49 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-27 17:24:49 +0000 |
commit | 5f46418438b0cd2570318fdcf03bb2e1e7855d9e (patch) | |
tree | eebcfc8997a36c08fbc72a11d8d5bddb97578aea /chrome/browser/views/toolbar_view.cc | |
parent | fc6536ff4a94bccc3df5c821922bdb4603283fd1 (diff) | |
download | chromium_src-5f46418438b0cd2570318fdcf03bb2e1e7855d9e.zip chromium_src-5f46418438b0cd2570318fdcf03bb2e1e7855d9e.tar.gz chromium_src-5f46418438b0cd2570318fdcf03bb2e1e7855d9e.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/100005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14618 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..860385f 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() + |