| Index: components/exo/shell_surface.cc
|
| diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
|
| index d93e6c717f64bf0c8805c77777c344d53006ca53..fbfcfba45dc1d73848d5ac2da7d7a02dd1f13ba4 100644
|
| --- a/components/exo/shell_surface.cc
|
| +++ b/components/exo/shell_surface.cc
|
| @@ -1414,10 +1414,18 @@ void ShellSurface::UpdateShadow() {
|
| shadow_underlay_->Hide();
|
| } else {
|
| wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM);
|
| -
|
| - gfx::Rect shadow_content_bounds = shadow_content_bounds_;
|
| - if (shadow_content_bounds.IsEmpty())
|
| - shadow_content_bounds = window->bounds();
|
| + gfx::Rect shadow_content_bounds =
|
| + gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_);
|
| + gfx::Rect shadow_underlay_bounds = shadow_content_bounds_;
|
| + if (shadow_underlay_bounds.IsEmpty())
|
| + shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size());
|
| +
|
| + if (!shadow_underlay_in_shell_surface_) {
|
| + shadow_content_bounds = shadow_content_bounds_;
|
| + if (shadow_content_bounds.IsEmpty()) {
|
| + shadow_content_bounds = window->bounds();
|
| + }
|
| + }
|
|
|
| // TODO(oshima): Adjust the coordinates from client screen to
|
| // chromeos screen when multi displays are supported.
|
| @@ -1440,8 +1448,16 @@ void ShellSurface::UpdateShadow() {
|
| shadow_underlay_->Init(ui::LAYER_SOLID_COLOR);
|
| shadow_underlay_->layer()->SetColor(SK_ColorBLACK);
|
| DCHECK(shadow_underlay_->layer()->fills_bounds_opaquely());
|
| - window->AddChild(shadow_underlay_);
|
| - window->StackChildAtBottom(shadow_underlay_);
|
| + if (!shadow_underlay_in_shell_surface_) {
|
| + window->AddChild(shadow_underlay_);
|
| + window->StackChildAtBottom(shadow_underlay_);
|
| + } else {
|
| + surface_->window()->AddChild(shadow_underlay_);
|
| + }
|
| + }
|
| +
|
| + if (shadow_underlay_in_shell_surface_) {
|
| + surface_->window()->StackChildAtBottom(shadow_underlay_);
|
| }
|
|
|
| bool underlay_capture_events =
|
| @@ -1459,14 +1475,19 @@ void ShellSurface::UpdateShadow() {
|
| if ((widget_->IsFullscreen() || underlay_capture_events) &&
|
| ash::wm::GetWindowState(window)->allow_set_bounds_in_maximized() &&
|
| window->layer()->GetTargetTransform().IsIdentity()) {
|
| - gfx::Point origin;
|
| - origin -= window->bounds().origin().OffsetFromOrigin();
|
| - shadow_bounds.set_origin(origin);
|
| - shadow_bounds.set_size(window->parent()->bounds().size());
|
| + if (!shadow_underlay_in_shell_surface_) {
|
| + gfx::Point origin;
|
| + origin -= window->bounds().origin().OffsetFromOrigin();
|
| + shadow_bounds.set_origin(origin);
|
| + shadow_bounds.set_size(window->parent()->bounds().size());
|
| + } else {
|
| + shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size());
|
| + }
|
| shadow_underlay_opacity = 1.0f;
|
| }
|
|
|
| - gfx::Rect shadow_underlay_bounds = shadow_bounds;
|
| + if (!shadow_underlay_in_shell_surface_)
|
| + shadow_underlay_bounds = shadow_bounds;
|
|
|
| // Constrain the underlay bounds to the client area in case shell surface
|
| // frame is enabled.
|
| @@ -1498,7 +1519,12 @@ void ShellSurface::UpdateShadow() {
|
| shadow_overlay_->Init(ui::LAYER_NOT_DRAWN);
|
| shadow_overlay_->layer()->Add(shadow->layer());
|
| window->AddChild(shadow_overlay_);
|
| - window->StackChildAbove(shadow_overlay_, shadow_underlay_);
|
| +
|
| + if (!shadow_underlay_in_shell_surface_) {
|
| + window->StackChildAbove(shadow_overlay_, shadow_underlay_);
|
| + } else {
|
| + window->StackChildBelow(shadow_overlay_, surface_->window());
|
| + }
|
| shadow_overlay_->Show();
|
| }
|
| shadow_overlay_->SetBounds(shadow_bounds);
|
|
|