diff options
author | robertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 16:30:36 +0000 |
---|---|---|
committer | robertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 16:30:36 +0000 |
commit | e98e82ac535ece8199fc0607b337b6cc1767e305 (patch) | |
tree | 4fe00b69bd025957d4ecbb9a5a5800d890eee7d0 /chrome | |
parent | 629855fd02bc07563a723df7bb0b0b56cf373cc1 (diff) | |
download | chromium_src-e98e82ac535ece8199fc0607b337b6cc1767e305.zip chromium_src-e98e82ac535ece8199fc0607b337b6cc1767e305.tar.gz chromium_src-e98e82ac535ece8199fc0607b337b6cc1767e305.tar.bz2 |
Reverting r14276 (http://codereview.chromium.org/88069) which causes unit test breakage.
Example: http://build.chromium.org/buildbot/waterfall/builders/XP%20Tests%20(dbg)(2)/builds/1268/steps/unit_tests/logs/stdio
TBR=http://codereview.chromium.org/95010
Review URL: http://codereview.chromium.org/95010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 31 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_browser_frame_view.cc | 178 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_browser_frame_view.h | 11 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 13 | ||||
-rw-r--r-- | chrome/views/widget/widget_win.h | 4 | ||||
-rw-r--r-- | chrome/views/window/non_client_view.cc | 7 | ||||
-rw-r--r-- | chrome/views/window/non_client_view.h | 1 | ||||
-rw-r--r-- | chrome/views/window/window_win.cc | 7 | ||||
-rw-r--r-- | chrome/views/window/window_win.h | 1 |
12 files changed, 68 insertions, 201 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index 364624c..5acf012 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -529,10 +529,6 @@ gfx::Size BookmarkBarView::GetPreferredSize() { return prefsize; } -gfx::Size BookmarkBarView::GetMinimumSize() { - return gfx::Size(0, kBarHeight); -} - void BookmarkBarView::Layout() { if (!GetParent()) return; @@ -895,9 +891,8 @@ bool BookmarkBarView::OnNewTabPage() { browser_->GetSelectedTabContents()->IsBookmarkBarAlwaysVisible()); } -int BookmarkBarView::GetToolbarOverlap(bool return_max) { - return static_cast<int>(kToolbarOverlap * - (return_max ? 1.0 : size_animation_->GetCurrentValue())); +int BookmarkBarView::GetToolbarOverlap() { + return static_cast<int>(size_animation_->GetCurrentValue() * kToolbarOverlap); } void BookmarkBarView::AnimationProgressed(const Animation* animation) { diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h index 5947c60..0726449 100644 --- a/chrome/browser/views/bookmark_bar_view.h +++ b/chrome/browser/views/bookmark_bar_view.h @@ -90,7 +90,6 @@ class BookmarkBarView : public views::View, // View methods: virtual gfx::Size GetPreferredSize(); - virtual gfx::Size GetMinimumSize(); virtual void Layout(); virtual void DidChangeBounds(const gfx::Rect& previous, const gfx::Rect& current); @@ -139,9 +138,8 @@ class BookmarkBarView : public views::View, // True if we're on a page where the bookmarks bar is always visible. bool OnNewTabPage(); - // How much we want the bookmark bar to overlap the toolbar. If |return_max| - // is true, we return the maximum overlap rather than the current overlap. - int GetToolbarOverlap(bool return_max); + // How much we want the bookmark bar to overlap the toolbar. + int GetToolbarOverlap(); // Whether or not we are animating. bool IsAnimating() { return size_animation_->IsAnimating(); } diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index b7906ed..e9378ff 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1164,35 +1164,6 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) { return views::ClientView::NonClientHitTest(point); } -gfx::Size BrowserView::GetMinimumSize() { - // TODO: In theory the tabstrip width should probably be - // (OTR + tabstrip + caption buttons) width. - gfx::Size tabstrip_size( - browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP) ? - tabstrip_->GetMinimumSize() : gfx::Size()); - gfx::Size toolbar_size( - (browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || - browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) ? - toolbar_->GetMinimumSize() : gfx::Size()); - if (tabstrip_size.height() && toolbar_size.height()) - toolbar_size.Enlarge(0, -kToolbarTabStripVerticalOverlap); - gfx::Size bookmark_bar_size; - if (active_bookmark_bar_ && - browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR)) { - bookmark_bar_size = active_bookmark_bar_->GetMinimumSize(); - bookmark_bar_size.Enlarge(0, - -kSeparationLineHeight - bookmark_bar_view_->GetToolbarOverlap(true)); - } - gfx::Size contents_size(contents_container_->GetMinimumSize()); - - int min_height = tabstrip_size.height() + toolbar_size.height() + - bookmark_bar_size.height() + contents_size.height(); - int widths[] = { tabstrip_size.width(), toolbar_size.width(), - bookmark_bar_size.width(), contents_size.width() }; - int min_width = *std::max_element(&widths[0], &widths[arraysize(widths)]); - return gfx::Size(min_width, min_height); -} - /////////////////////////////////////////////////////////////////////////////// // BrowserView, views::View overrides: @@ -1356,7 +1327,7 @@ int BrowserView::LayoutBookmarkBar(int top) { int height, y = top; if (visible) { y -= kSeparationLineHeight + (bookmark_bar_view_->IsDetachedStyle() ? - 0 : bookmark_bar_view_->GetToolbarOverlap(false)); + 0 : bookmark_bar_view_->GetToolbarOverlap()); height = bookmark_bar_view_->GetPreferredSize().height(); } else { height = 0; diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 8bfb180..30b5aaf6 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -243,7 +243,6 @@ class BrowserView : public BrowserWindow, // Overridden from views::ClientView: virtual bool CanClose() const; virtual int NonClientHitTest(const gfx::Point& point); - virtual gfx::Size GetMinimumSize(); // Is P13N enabled for this browser window? #ifdef CHROME_PERSONALIZATION diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index a93449f..ef80018 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -442,26 +442,6 @@ void OpaqueBrowserFrameView::UpdateThrobber(bool running) { window_icon_->Update(); } -gfx::Size OpaqueBrowserFrameView::GetMinimumSize() { - gfx::Size min_size(browser_view_->GetMinimumSize()); - int border_thickness = NonClientBorderThickness(); - min_size.Enlarge(2 * border_thickness, - NonClientTopBorderHeight() + border_thickness); - - views::WindowDelegate* d = frame_->GetDelegate(); - int min_titlebar_width = (2 * FrameBorderThickness()) + kIconLeftSpacing + - (d->ShouldShowWindowIcon() ? - (IconSize(NULL, NULL, NULL) + kTitleLogoSpacing) : 0) + - ((distributor_logo_ && browser_view_->ShouldShowDistributorLogo()) ? - (distributor_logo_->width() + kLogoCaptionSpacing) : 0) + - minimize_button_->GetMinimumSize().width() + - restore_button_->GetMinimumSize().width() + - close_button_->GetMinimumSize().width(); - min_size.set_width(std::max(min_size.width(), min_titlebar_width)); - - return min_size; -} - /////////////////////////////////////////////////////////////////////////////// // OpaqueBrowserFrameView, views::NonClientFrameView implementation: @@ -683,8 +663,10 @@ int OpaqueBrowserFrameView::NonClientBorderThickness() const { } int OpaqueBrowserFrameView::NonClientTopBorderHeight() const { - if (frame_->GetDelegate()->ShouldShowWindowTitle()) - return TitleCoordinates(NULL, NULL); + if (frame_->GetDelegate()->ShouldShowWindowTitle()) { + int title_top_spacing, title_thickness; + return TitleCoordinates(&title_top_spacing, &title_thickness); + } return FrameBorderThickness() + ((frame_->IsMaximized() || frame_->IsFullscreen()) ? @@ -703,11 +685,11 @@ int OpaqueBrowserFrameView::UnavailablePixelsAtBottomOfNonClientHeight() const { (frame_->IsMaximized() ? 0 : kClientEdgeThickness); } -int OpaqueBrowserFrameView::TitleCoordinates(int* title_top_spacing_ptr, - int* title_thickness_ptr) const { +int OpaqueBrowserFrameView::TitleCoordinates(int* title_top_spacing, + int* title_thickness) const { int frame_thickness = FrameBorderThickness(); int min_titlebar_height = kTitlebarMinimumHeight + frame_thickness; - int title_top_spacing = frame_thickness + kTitleTopSpacing; + *title_top_spacing = frame_thickness + kTitleTopSpacing; // The bottom spacing should be the same apparent height as the top spacing. // Because the actual top spacing height varies based on the system border // thickness, we calculate this based on the restored top spacing and then @@ -721,38 +703,15 @@ int OpaqueBrowserFrameView::TitleCoordinates(int* title_top_spacing_ptr, // When we maximize, the top border appears to be chopped off; shift the // title down to stay centered within the remaining space. int title_adjust = (kFrameBorderThickness / 2); - title_top_spacing += title_adjust; + *title_top_spacing += title_adjust; title_bottom_spacing -= title_adjust; } - int title_thickness = std::max(title_font_->height(), - min_titlebar_height - title_top_spacing - title_bottom_spacing); - if (title_top_spacing_ptr) - *title_top_spacing_ptr = title_top_spacing; - if (title_thickness_ptr) - *title_thickness_ptr = title_thickness; - return title_top_spacing + title_thickness + title_bottom_spacing + + *title_thickness = std::max(title_font_->height(), + min_titlebar_height - *title_top_spacing - title_bottom_spacing); + return *title_top_spacing + *title_thickness + title_bottom_spacing + UnavailablePixelsAtBottomOfNonClientHeight(); } -int OpaqueBrowserFrameView::IconSize(int* title_top_spacing_ptr, - int* title_thickness_ptr, - int* available_height_ptr) const { - // The usable height of the titlebar area is the total height minus the top - // resize border and any edge area we draw at its bottom. - int frame_thickness = FrameBorderThickness(); - int top_height = TitleCoordinates(title_top_spacing_ptr, title_thickness_ptr); - int available_height = top_height - frame_thickness - - UnavailablePixelsAtBottomOfNonClientHeight(); - if (available_height_ptr) - *available_height_ptr = available_height; - - // The icon takes up a constant fraction of the available height, down to a - // minimum size, and is always an even number of pixels on a side (presumably - // to make scaled icons look better). It's centered within the usable height. - return std::max((available_height * kIconHeightFractionNumerator / - kIconHeightFractionDenominator) / 2 * 2, kIconMinimumSize); -} - void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) { SkBitmap* top_left_corner = resources()->GetPartBitmap(FRAME_TOP_LEFT_CORNER); SkBitmap* top_right_corner = @@ -767,17 +726,11 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) { SkBitmap* bottom_edge = resources()->GetPartBitmap(FRAME_BOTTOM_EDGE); // Top. - int top_left_height = std::min(top_left_corner->height(), - height() - bottom_left_corner->height()); - canvas->DrawBitmapInt(*top_left_corner, 0, 0, top_left_corner->width(), - top_left_height, 0, 0, top_left_corner->width(), top_left_height, false); + canvas->DrawBitmapInt(*top_left_corner, 0, 0); canvas->TileImageInt(*top_edge, top_left_corner->width(), 0, width() - top_right_corner->width(), top_edge->height()); - int top_right_height = std::min(top_right_corner->height(), - height() - bottom_right_corner->height()); - canvas->DrawBitmapInt(*top_right_corner, 0, 0, top_right_corner->width(), - top_right_height, width() - top_right_corner->width(), 0, - top_right_corner->width(), top_right_height, false); + canvas->DrawBitmapInt(*top_right_corner, + width() - top_right_corner->width(), 0); // Note: When we don't have a toolbar, we need to draw some kind of bottom // edge here. Because the App Window graphics we use for this have an // attached client edge and their sizing algorithm is a little involved, we do @@ -785,8 +738,9 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) { // Right. canvas->TileImageInt(*right_edge, width() - right_edge->width(), - top_right_height, right_edge->width(), - height() - top_right_height - bottom_right_corner->height()); + top_right_corner->height(), right_edge->width(), + height() - top_right_corner->height() - + bottom_right_corner->height()); // Bottom. canvas->DrawBitmapInt(*bottom_right_corner, @@ -801,8 +755,9 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) { height() - bottom_left_corner->height()); // Left. - canvas->TileImageInt(*left_edge, 0, top_left_height, left_edge->width(), - height() - top_left_height - bottom_left_corner->height()); + canvas->TileImageInt(*left_edge, 0, top_left_corner->height(), + left_edge->width(), + height() - top_left_corner->height() - bottom_left_corner->height()); } void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) { @@ -857,44 +812,29 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) { View::ConvertPointToView(frame_->GetClientView(), this, &toolbar_origin); toolbar_bounds.set_origin(toolbar_origin); - // Gross hack: We split the toolbar images into two pieces, since sometimes + SkBitmap* toolbar_left = + resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT); + canvas->DrawBitmapInt(*toolbar_left, + toolbar_bounds.x() - toolbar_left->width(), + toolbar_bounds.y()); + + // Gross hack: We split the toolbar image into two pieces, since sometimes // (popup mode) the toolbar isn't tall enough to show the whole image. The // split happens between the top shadow section and the bottom gradient // section so that we never break the gradient. int split_point = kFrameShadowThickness * 2; - int bottom_y = toolbar_bounds.y() + split_point; - SkBitmap* toolbar_left = - resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT); - int bottom_edge_height = - std::min(toolbar_left->height(), toolbar_bounds.height()) - split_point; - - canvas->DrawBitmapInt(*toolbar_left, 0, 0, toolbar_left->width(), split_point, - toolbar_bounds.x() - toolbar_left->width(), toolbar_bounds.y(), - toolbar_left->width(), split_point, false); - canvas->DrawBitmapInt(*toolbar_left, 0, - toolbar_left->height() - bottom_edge_height, toolbar_left->width(), - bottom_edge_height, toolbar_bounds.x() - toolbar_left->width(), bottom_y, - toolbar_left->width(), bottom_edge_height, false); - SkBitmap* toolbar_center = resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP); canvas->TileImageInt(*toolbar_center, 0, 0, toolbar_bounds.x(), toolbar_bounds.y(), toolbar_bounds.width(), split_point); - int bottom_center_height = - std::min(toolbar_center->height(), toolbar_bounds.height()) - split_point; canvas->TileImageInt(*toolbar_center, 0, - toolbar_center->height() - bottom_center_height, toolbar_bounds.x(), - bottom_y, toolbar_bounds.width(), bottom_center_height); - - SkBitmap* toolbar_right = - resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_RIGHT); - canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(), - split_point, toolbar_bounds.right(), toolbar_bounds.y(), - toolbar_right->width(), split_point, false); - canvas->DrawBitmapInt(*toolbar_right, 0, - toolbar_right->height() - bottom_edge_height, toolbar_right->width(), - bottom_edge_height, toolbar_bounds.right(), bottom_y, - toolbar_right->width(), bottom_edge_height, false); + toolbar_center->height() - toolbar_bounds.height() + split_point, + toolbar_bounds.x(), toolbar_bounds.y() + split_point, + toolbar_bounds.width(), toolbar_bounds.height() - split_point); + + canvas->DrawBitmapInt( + *resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_RIGHT), + toolbar_bounds.right(), toolbar_bounds.y()); } void OpaqueBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) { @@ -914,12 +854,10 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) { gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); if (browser_view_->IsToolbarVisible()) { - // The client edges start below the toolbar or its corner images, whichever - // is shorter. - gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds()); - client_area_top += toolbar_bounds.y() + std::min( - resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT)->height(), - toolbar_bounds.height()); + // The client edges start below the toolbar upper corner images regardless + // of how tall the toolbar itself is. + client_area_top += browser_view_->GetToolbarBounds().y() + + resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT)->height(); } else { // The toolbar isn't going to draw a client edge for us, so draw one // ourselves. @@ -927,23 +865,18 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) { // shorter than the top left and right bitmaps. We need their top edges to // line up, and we need the left and right edges to start below the corners' // bottoms. - SkBitmap* top_left = resources()->GetPartBitmap(FRAME_NO_TOOLBAR_TOP_LEFT); SkBitmap* top_center = resources()->GetPartBitmap(FRAME_NO_TOOLBAR_TOP_CENTER); - SkBitmap* top_right = - resources()->GetPartBitmap(FRAME_NO_TOOLBAR_TOP_RIGHT); + SkBitmap* top_left = resources()->GetPartBitmap(FRAME_NO_TOOLBAR_TOP_LEFT); int top_edge_y = client_area_top - top_center->height(); - client_area_top = std::min(top_edge_y + top_left->height(), - height() - NonClientBorderThickness()); - int height = client_area_top - top_edge_y; - canvas->DrawBitmapInt(*top_left, 0, 0, top_left->width(), height, - client_area_bounds.x() - top_left->width(), top_edge_y, - top_left->width(), height, false); - canvas->TileImageInt(*top_center, 0, 0, client_area_bounds.x(), top_edge_y, - client_area_bounds.width(), std::min(height, top_center->height())); - canvas->DrawBitmapInt(*top_right, 0, 0, top_right->width(), height, - client_area_bounds.right(), top_edge_y, - top_right->width(), height, false); + client_area_top = top_edge_y + top_left->height(); + canvas->DrawBitmapInt(*top_left, client_area_bounds.x() - top_left->width(), + top_edge_y); + canvas->TileImageInt(*top_center, client_area_bounds.x(), top_edge_y, + client_area_bounds.width(), top_center->height()); + canvas->DrawBitmapInt( + *resources()->GetPartBitmap(FRAME_NO_TOOLBAR_TOP_RIGHT), + client_area_bounds.right(), top_edge_y); } int client_area_bottom = @@ -1037,10 +970,19 @@ void OpaqueBrowserFrameView::LayoutTitleBar() { int frame_thickness = FrameBorderThickness(); int icon_x = frame_thickness + kIconLeftSpacing; - InitAppWindowResources(); // ! Should we do this? Isn't this a perf hit? - int title_top_spacing, title_thickness, available_height; - int icon_size = - IconSize(&title_top_spacing, &title_thickness, &available_height); + // The usable height of the titlebar area is the total height minus the top + // resize border and any edge area we draw at its bottom. + int title_top_spacing, title_thickness; + InitAppWindowResources(); + int top_height = TitleCoordinates(&title_top_spacing, &title_thickness); + int available_height = top_height - frame_thickness - + UnavailablePixelsAtBottomOfNonClientHeight(); + + // The icon takes up a constant fraction of the available height, down to a + // minimum size, and is always an even number of pixels on a side (presumably + // to make scaled icons look better). It's centered within the usable height. + int icon_size = std::max((available_height * kIconHeightFractionNumerator / + kIconHeightFractionDenominator) / 2 * 2, kIconMinimumSize); int icon_y = ((available_height - icon_size) / 2) + frame_thickness; // Hack: Our frame border has a different "3D look" than Windows'. Theirs has diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h index ecbab36..fd80b7c 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/views/frame/opaque_browser_frame_view.h @@ -32,7 +32,6 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, // Overridden from BrowserNonClientFrameView: virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual void UpdateThrobber(bool running); - virtual gfx::Size GetMinimumSize(); protected: // Overridden from views::NonClientFrameView: @@ -88,14 +87,8 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, // Calculates multiple values related to title layout. Returns the height of // the entire titlebar including any connected client edge. - int TitleCoordinates(int* title_top_spacing_ptr, - int* title_thickness_ptr) const; - - // Calculates multiple values related to icon layout. Returns the size of the - // icon (along one edge). - int IconSize(int* title_top_spacing_ptr, - int* title_thickness_ptr, - int* available_height_ptr) const; + int TitleCoordinates(int* title_top_spacing, + int* title_thickness) const; // Paint various sub-components of this view. The *FrameBorder() functions // also paint the background of the titlebar area, since the top frame border diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 31bf7d2..d5136b6 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -534,23 +534,12 @@ 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(min_width, normal_background.height()); + return gfx::Size(0, normal_background.height()); } int vertical_spacing = PopupTopSpacing() + diff --git a/chrome/views/widget/widget_win.h b/chrome/views/widget/widget_win.h index 110a0b4..ede4252 100644 --- a/chrome/views/widget/widget_win.h +++ b/chrome/views/widget/widget_win.h @@ -178,7 +178,6 @@ class WidgetWin : public Widget, MSG_WM_ENDSESSION(OnEndSession) MSG_WM_ENTERSIZEMOVE(OnEnterSizeMove) MSG_WM_EXITMENULOOP(OnExitMenuLoop) - MSG_WM_GETMINMAXINFO(OnGetMinMaxInfo) MSG_WM_HSCROLL(OnHScroll) MSG_WM_INITMENU(OnInitMenu) MSG_WM_INITMENUPOPUP(OnInitMenuPopup) @@ -377,9 +376,6 @@ class WidgetWin : public Widget, } virtual LRESULT OnEraseBkgnd(HDC dc); virtual LRESULT OnGetObject(UINT uMsg, WPARAM w_param, LPARAM l_param); - virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info) { - SetMsgHandled(FALSE); - } virtual void OnHScroll(int scroll_type, short position, HWND scrollbar) { SetMsgHandled(FALSE); } diff --git a/chrome/views/window/non_client_view.cc b/chrome/views/window/non_client_view.cc index 29daf06..bc69587 100644 --- a/chrome/views/window/non_client_view.cc +++ b/chrome/views/window/non_client_view.cc @@ -131,17 +131,10 @@ void NonClientView::LayoutFrameView() { // NonClientView, View overrides: gfx::Size NonClientView::GetPreferredSize() { - // TODO(pkasting): This should probably be made to look similar to - // GetMinimumSize() below. This will require implementing GetPreferredSize() - // better in the various frame views. gfx::Rect client_bounds(gfx::Point(), client_view_->GetPreferredSize()); return GetWindowBoundsForClientBounds(client_bounds).size(); } -gfx::Size NonClientView::GetMinimumSize() { - return frame_view_->GetMinimumSize(); -} - void NonClientView::Layout() { LayoutFrameView(); diff --git a/chrome/views/window/non_client_view.h b/chrome/views/window/non_client_view.h index e82ec77..0481cfd 100644 --- a/chrome/views/window/non_client_view.h +++ b/chrome/views/window/non_client_view.h @@ -192,7 +192,6 @@ class NonClientView : public View { // NonClientView, View overrides: virtual gfx::Size GetPreferredSize(); - virtual gfx::Size GetMinimumSize(); virtual void Layout(); protected: diff --git a/chrome/views/window/window_win.cc b/chrome/views/window/window_win.cc index 8c03219..3d2c74f 100644 --- a/chrome/views/window/window_win.cc +++ b/chrome/views/window/window_win.cc @@ -640,13 +640,6 @@ void WindowWin::OnFinalMessage(HWND window) { WidgetWin::OnFinalMessage(window); } -void WindowWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { - gfx::Size min_window_size(GetNonClientView()->GetMinimumSize()); - minmax_info->ptMinTrackSize.x = min_window_size.width(); - minmax_info->ptMinTrackSize.y = min_window_size.height(); - WidgetWin::OnGetMinMaxInfo(minmax_info); -} - namespace { static void EnableMenuItem(HMENU menu, UINT command, bool enabled) { UINT flags = MF_BYCOMMAND | (enabled ? MF_ENABLED : MF_DISABLED | MF_GRAYED); diff --git a/chrome/views/window/window_win.h b/chrome/views/window/window_win.h index 222ac52..cd7bd50 100644 --- a/chrome/views/window/window_win.h +++ b/chrome/views/window/window_win.h @@ -129,7 +129,6 @@ class WindowWin : public WidgetWin, virtual LRESULT OnDwmCompositionChanged(UINT msg, WPARAM w_param, LPARAM l_param); virtual void OnFinalMessage(HWND window); - virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info); virtual void OnInitMenu(HMENU menu); virtual void OnMouseLeave(); virtual LRESULT OnNCActivate(BOOL active); |