Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
index 3fa2a16a7e8d32770cc9046255e4b04bdd1c3cf6..5d94e6a96578789708863524a6dd7ba081c66a58 100644 |
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc |
@@ -135,11 +135,6 @@ gfx::Rect BrowserNonClientFrameViewMus::GetBoundsForTabStrip( |
if (!tabstrip) |
return gfx::Rect(); |
- // When the tab strip is painted in the immersive fullscreen light bar style, |
- // the caption buttons and the avatar button are not visible. However, their |
- // bounds are still used to compute the tab strip bounds so that the tabs have |
- // the same horizontal position when the tab strip is painted in the immersive |
- // light bar style as when the top-of-window views are revealed. |
int left_inset = GetTabStripLeftInset(); |
int right_inset = GetTabStripRightInset(); |
return gfx::Rect(left_inset, GetTopInset(false), |
@@ -148,7 +143,7 @@ gfx::Rect BrowserNonClientFrameViewMus::GetBoundsForTabStrip( |
} |
int BrowserNonClientFrameViewMus::GetTopInset(bool restored) const { |
- if (!ShouldPaint() || UseImmersiveLightbarHeaderStyle()) |
+ if (!ShouldPaint() || IsImmersiveFullscreenUnrevealed()) |
return 0; |
if (browser_view()->IsTabStripVisible()) { |
@@ -296,13 +291,6 @@ void BrowserNonClientFrameViewMus::OnPaint(gfx::Canvas* canvas) { |
if (!ShouldPaint()) |
return; |
- // TODO(sky): get immersive mode working. |
- |
- if (UseImmersiveLightbarHeaderStyle()) { |
- PaintImmersiveLightbarStyleHeader(canvas); |
- return; |
- } |
- |
if (browser_view()->IsToolbarVisible()) |
PaintToolbarBackground(canvas); |
else if (!UsePackagedAppHeaderStyle()) |
@@ -416,12 +404,11 @@ int BrowserNonClientFrameViewMus::GetTabStripRightInset() const { |
return right_inset; |
} |
-bool BrowserNonClientFrameViewMus::UseImmersiveLightbarHeaderStyle() const { |
+bool BrowserNonClientFrameViewMus::IsImmersiveFullscreenUnrevealed() const { |
ImmersiveModeController* immersive_controller = |
browser_view()->immersive_mode_controller(); |
return immersive_controller->IsEnabled() && |
- !immersive_controller->IsRevealed() && |
- browser_view()->IsTabStripVisible(); |
+ !immersive_controller->IsRevealed(); |
} |
bool BrowserNonClientFrameViewMus::UsePackagedAppHeaderStyle() const { |
@@ -442,10 +429,9 @@ void BrowserNonClientFrameViewMus::LayoutIncognitoButton() { |
kAvatarIconPadding; |
int avatar_y = avatar_bottom - incognito_icon.height(); |
- // Hide the incognito icon in immersive fullscreen when the tab light bar is |
- // visible because the header is too short for the icognito icon to be |
- // recognizable. |
- bool avatar_visible = !UseImmersiveLightbarHeaderStyle(); |
+ // Hide the incognito icon in immersive fullscreen unrevealed state because |
+ // the header height is zero for displaying the icon. |
+ bool avatar_visible = !IsImmersiveFullscreenUnrevealed(); |
int avatar_height = avatar_visible ? incognito_icon.height() : 0; |
gfx::Rect avatar_bounds(kAvatarIconPadding, avatar_y, incognito_icon.width(), |
@@ -467,19 +453,14 @@ bool BrowserNonClientFrameViewMus::ShouldPaint() const { |
if (!frame()->IsFullscreen()) |
return true; |
- // We need to paint when in immersive fullscreen and either: |
- // - The top-of-window views are revealed. |
- // - The lightbar style tabstrip is visible. |
+ // We need to paint when the top-of-window views are revealed in immersive |
+ // fullscreen. |
ImmersiveModeController* immersive_mode_controller = |
browser_view()->immersive_mode_controller(); |
return immersive_mode_controller->IsEnabled() && |
- (immersive_mode_controller->IsRevealed() || |
- UseImmersiveLightbarHeaderStyle()); |
+ immersive_mode_controller->IsRevealed(); |
} |
-void BrowserNonClientFrameViewMus::PaintImmersiveLightbarStyleHeader( |
- gfx::Canvas* canvas) {} |
- |
void BrowserNonClientFrameViewMus::PaintToolbarBackground(gfx::Canvas* canvas) { |
gfx::Rect toolbar_bounds(browser_view()->GetToolbarBounds()); |
if (toolbar_bounds.IsEmpty()) |