Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc

Issue 10821002: Makes the min window size include the OTR image and caption buttons on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
index 14d4faf1d06e271a19143abae6e2c9b7bfaab874..1332fbd37b1907c9a071514b11a4208b19c91a3d 100644
--- a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
@@ -191,21 +191,19 @@ gfx::Rect BrowserNonClientFrameViewAsh::GetBoundsForTabStrip(
views::View* tabstrip) const {
if (!tabstrip)
return gfx::Rect();
- int tabstrip_x =
- avatar_button() ?
- (avatar_button()->bounds().right() + kAvatarSideSpacing) :
- kTabstripLeftSpacing;
- int tabstrip_width =
- size_button_->x() - kTabstripRightSpacing - tabstrip_x;
- return gfx::Rect(tabstrip_x,
- GetHorizontalTabStripVerticalOffset(false),
- std::max(0, tabstrip_width),
+ TabStripInsets insets(GetTabStripInsets(false));
+ return gfx::Rect(insets.left, insets.top,
+ std::max(0, width() - insets.left - insets.right),
tabstrip->GetPreferredSize().height());
}
-int BrowserNonClientFrameViewAsh::GetHorizontalTabStripVerticalOffset(
- bool force_restored) const {
- return NonClientTopBorderHeight(force_restored);
+BrowserNonClientFrameView::TabStripInsets
+BrowserNonClientFrameViewAsh::GetTabStripInsets(bool force_restored) const {
+ int left = avatar_button() ? kAvatarSideSpacing +
+ browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing :
+ kTabstripLeftSpacing;
+ int right = frame_painter_->GetRightInset() + kTabstripRightSpacing;
+ return TabStripInsets(NonClientTopBorderHeight(force_restored), left, right);
}
void BrowserNonClientFrameViewAsh::UpdateThrobber(bool running) {
@@ -320,8 +318,7 @@ void BrowserNonClientFrameViewAsh::OnPaint(gfx::Canvas* canvas) {
}
void BrowserNonClientFrameViewAsh::Layout() {
- bool maximized_layout = UseShortHeader();
- frame_painter_->LayoutHeader(this, maximized_layout);
+ frame_painter_->LayoutHeader(this, UseShortHeader());
if (avatar_button())
LayoutAvatar();
BrowserNonClientFrameView::Layout();
@@ -474,7 +471,7 @@ void BrowserNonClientFrameViewAsh::LayoutAvatar() {
DCHECK(avatar_button());
gfx::ImageSkia incognito_icon = browser_view()->GetOTRAvatarIcon();
- int avatar_bottom = GetHorizontalTabStripVerticalOffset(false) +
+ int avatar_bottom = GetTabStripInsets(false).top +
browser_view()->GetTabStripHeight() - kAvatarBottomSpacing;
int avatar_restored_y = avatar_bottom - incognito_icon.height();
int avatar_y = frame()->IsMaximized() ?
@@ -524,7 +521,7 @@ void BrowserNonClientFrameViewAsh::PaintToolbarBackground(
browser_view()->GetToolbarBackgroundImage(mode);
canvas->TileImageInt(
*theme_toolbar,
- x, bottom_y - GetHorizontalTabStripVerticalOffset(false),
+ x, bottom_y - GetTabStripInsets(false).top,
x, bottom_y,
w, theme_toolbar->height());

Powered by Google App Engine
This is Rietveld 408576698