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

Unified Diff: components/exo/shell_surface.cc

Issue 2251543002: Add solid black background for arc immersive fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comment Created 4 years, 4 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
« no previous file with comments | « no previous file | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 7bafb9d1fd5273a0a6a5c83957fd6682c131fa4f..fd139ba74b271fb8623b1019407147e41168846c 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -1250,9 +1250,26 @@ void ShellSurface::UpdateShadow() {
window->AddChild(shadow_underlay_);
window->StackChildAtBottom(shadow_underlay_);
}
- shadow_underlay_->layer()->SetOpacity(
- rectangular_shadow_background_opacity_);
- shadow_underlay_->SetBounds(shadow_bounds);
+
+ // Put the black background layer behind the window if
+ // 1) the window is in immersive fullscreen.
+ // 2) the window can control the bounds of the window in fullscreen (
+ // thus the background can be visible).
+ // 3) the window has no transform (the transformed background may
+ // not cover the entire background, e.g. overview mode).
+ if (widget_->IsFullscreen() &&
+ ash::wm::GetWindowState(window)->allow_set_bounds_in_maximized() &&
+ window->layer()->transform().IsIdentity()) {
+ gfx::Point origin;
+ origin -= window->bounds().origin().OffsetFromOrigin();
+ gfx::Rect background_bounds(origin, window->parent()->bounds().size());
+ shadow_underlay_->SetBounds(background_bounds);
+ shadow_underlay_->layer()->SetOpacity(1.f);
+ } else {
+ shadow_underlay_->SetBounds(shadow_bounds);
+ shadow_underlay_->layer()->SetOpacity(
+ rectangular_shadow_background_opacity_);
+ }
shadow_underlay_->Show();
wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window);
« no previous file with comments | « no previous file | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698