Index: components/exo/shell_surface.cc |
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc |
index 1535bac087c9561f9079fbeb6d3117872854a161..6687ddd47186c2e821a32b06ca479c831c114a73 100644 |
--- a/components/exo/shell_surface.cc |
+++ b/components/exo/shell_surface.cc |
@@ -1558,15 +1558,7 @@ void ShellSurface::UpdateShadow() { |
if (!widget_ || !surface_) |
return; |
aura::Window* window = widget_->GetNativeWindow(); |
- |
- bool underlay_capture_events = |
- WMHelper::GetInstance()->IsSpokenFeedbackEnabled() && widget_->IsActive(); |
- bool black_background_enabled = |
- ((widget_->IsFullscreen() || widget_->IsMaximized()) || |
- underlay_capture_events) && |
- ash::wm::GetWindowState(window)->allow_set_bounds_direct() && |
- window->layer()->GetTargetTransform().IsIdentity(); |
- if (!shadow_enabled_ && !black_background_enabled) { |
+ if (!shadow_enabled_) { |
wm::SetShadowElevation(window, wm::ShadowElevation::NONE); |
if (shadow_underlay_) |
shadow_underlay_->Hide(); |
@@ -1634,6 +1626,10 @@ void ShellSurface::UpdateShadow() { |
} |
} |
+ bool underlay_capture_events = |
+ WMHelper::GetInstance()->IsSpokenFeedbackEnabled() && |
+ widget_->IsActive(); |
+ |
float shadow_underlay_opacity = shadow_background_opacity_; |
// Put the black background layer behind the window if |
@@ -1643,7 +1639,10 @@ void ShellSurface::UpdateShadow() { |
// 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 (black_background_enabled) { |
+ if ((widget_->IsFullscreen() || widget_->IsMaximized() || |
+ underlay_capture_events) && |
+ ash::wm::GetWindowState(window)->allow_set_bounds_direct() && |
+ window->layer()->GetTargetTransform().IsIdentity()) { |
if (shadow_underlay_in_surface_) { |
shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size()); |
} else { |
@@ -1658,8 +1657,6 @@ void ShellSurface::UpdateShadow() { |
if (!shadow_underlay_in_surface_) |
shadow_underlay_bounds = shadow_bounds; |
- shadow_underlay_->SetBounds(shadow_underlay_bounds); |
- |
// Constrain the underlay bounds to the client area in case shell surface |
// frame is enabled. |
if (frame_enabled_) { |
@@ -1667,6 +1664,8 @@ void ShellSurface::UpdateShadow() { |
widget_->non_client_view()->frame_view()->GetBoundsForClientView()); |
} |
+ shadow_underlay_->SetBounds(shadow_underlay_bounds); |
+ |
shadow_underlay_->Show(); |
// TODO(oshima): Setting to the same value should be no-op. |