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

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

Issue 1412833008: Draw the same portion of the frame background behind the tabstrip in maximized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@match_frame_alignment
Patch Set: Add comment Created 5 years, 1 month 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/frame/browser_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
index 444aad22f38f5f79ac4449b504ebf5a743afab31..cc6a6bc770c824df73ad32c01816275e2f6ba68f 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -166,17 +166,17 @@ gfx::Rect BrowserNonClientFrameViewAsh::GetBoundsForTabStrip(
int left_inset = GetTabStripLeftInset();
int right_inset = GetTabStripRightInset();
return gfx::Rect(left_inset,
- GetTopInset(),
+ GetTopInset(false),
std::max(0, width() - left_inset - right_inset),
tabstrip->GetPreferredSize().height());
}
-int BrowserNonClientFrameViewAsh::GetTopInset() const {
+int BrowserNonClientFrameViewAsh::GetTopInset(bool restored) const {
if (!ShouldPaint() || UseImmersiveLightbarHeaderStyle())
return 0;
if (browser_view()->IsTabStripVisible()) {
- return (frame()->IsMaximized() || frame()->IsFullscreen()) ?
+ return ((frame()->IsMaximized() || frame()->IsFullscreen()) && !restored) ?
kTabstripTopSpacingShort : kTabstripTopSpacingTall;
}
@@ -332,14 +332,14 @@ void BrowserNonClientFrameViewAsh::Layout() {
int painted_height = 0;
if (browser_view()->IsTabStripVisible()) {
- painted_height = GetTopInset() +
+ painted_height = GetTopInset(false) +
browser_view()->tabstrip()->GetPreferredSize().height();
} else if (browser_view()->IsToolbarVisible()) {
// Paint the header so that it overlaps with the top few pixels of the
// toolbar because the top few pixels of the toolbar are not opaque.
- painted_height = GetTopInset() + kFrameShadowThickness * 2;
+ painted_height = GetTopInset(false) + kFrameShadowThickness * 2;
} else {
- painted_height = GetTopInset();
+ painted_height = GetTopInset(false);
}
header_painter_->SetHeaderHeightForPainting(painted_height);
@@ -491,7 +491,7 @@ bool BrowserNonClientFrameViewAsh::DoesIntersectRect(
}
// Claim |rect| if it is above the top of the topmost view in the client area.
- return rect.y() < GetTopInset();
+ return rect.y() < GetTopInset(false);
}
int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const {
@@ -547,13 +547,13 @@ void BrowserNonClientFrameViewAsh::LayoutAvatar() {
#endif
gfx::ImageSkia incognito_icon = browser_view()->GetOTRAvatarIcon();
gfx::Insets avatar_insets = GetLayoutInsets(AVATAR_ICON);
- int avatar_bottom = GetTopInset() + browser_view()->GetTabStripHeight() -
+ int avatar_bottom = GetTopInset(false) + browser_view()->GetTabStripHeight() -
avatar_insets.bottom();
int avatar_y = avatar_bottom - incognito_icon.height();
if (!ui::MaterialDesignController::IsModeMaterial() &&
browser_view()->IsTabStripVisible() &&
(frame()->IsMaximized() || frame()->IsFullscreen())) {
- avatar_y = GetTopInset() + kContentShadowHeight;
+ avatar_y = GetTopInset(false) + kContentShadowHeight;
}
// Hide the incognito icon in immersive fullscreen when the tab light bar is
@@ -631,7 +631,7 @@ void BrowserNonClientFrameViewAsh::PaintToolbarBackground(gfx::Canvas* canvas) {
canvas->TileImageInt(
*theme_toolbar,
x + GetThemeBackgroundXInset(),
- y - GetTopInset(),
+ y - GetTopInset(false),
x, y,
w, theme_toolbar->height());
@@ -665,7 +665,7 @@ void BrowserNonClientFrameViewAsh::PaintToolbarBackground(gfx::Canvas* canvas) {
canvas->TileImageInt(
*theme_toolbar,
x + GetThemeBackgroundXInset(),
- bottom_y - GetTopInset(),
+ bottom_y - GetTopInset(false),
x, bottom_y,
w, theme_toolbar->height());
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698