| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/frame/custom_frame_view_ash.h" | 9 #include "ash/common/frame/custom_frame_view_ash.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 window->AddChild(shadow_underlay_); | 1510 window->AddChild(shadow_underlay_); |
| 1511 window->StackChildAtBottom(shadow_underlay_); | 1511 window->StackChildAtBottom(shadow_underlay_); |
| 1512 } | 1512 } |
| 1513 } | 1513 } |
| 1514 | 1514 |
| 1515 bool underlay_capture_events = | 1515 bool underlay_capture_events = |
| 1516 WMHelper::GetInstance()->IsSpokenFeedbackEnabled() && | 1516 WMHelper::GetInstance()->IsSpokenFeedbackEnabled() && |
| 1517 widget_->IsActive(); | 1517 widget_->IsActive(); |
| 1518 | 1518 |
| 1519 float shadow_underlay_opacity = shadow_background_opacity_; | 1519 float shadow_underlay_opacity = shadow_background_opacity_; |
| 1520 |
| 1520 // Put the black background layer behind the window if | 1521 // Put the black background layer behind the window if |
| 1521 // 1) the window is in immersive fullscreen or is active with | 1522 // 1) the window is in immersive fullscreen, maximized or is active with |
| 1522 // spoken feedback enabled. | 1523 // spoken feedback enabled. |
| 1523 // 2) the window can control the bounds of the window in fullscreen ( | 1524 // 2) the window can control the bounds of the window in fullscreen ( |
| 1524 // thus the background can be visible). | 1525 // thus the background can be visible). |
| 1525 // 3) the window has no transform (the transformed background may | 1526 // 3) the window has no transform (the transformed background may |
| 1526 // not cover the entire background, e.g. overview mode). | 1527 // not cover the entire background, e.g. overview mode). |
| 1527 if ((widget_->IsFullscreen() || underlay_capture_events) && | 1528 if ((widget_->IsFullscreen() || widget_->IsMaximized() || |
| 1529 underlay_capture_events) && |
| 1528 ash::wm::GetWindowState(window)->allow_set_bounds_in_maximized() && | 1530 ash::wm::GetWindowState(window)->allow_set_bounds_in_maximized() && |
| 1529 window->layer()->GetTargetTransform().IsIdentity()) { | 1531 window->layer()->GetTargetTransform().IsIdentity()) { |
| 1530 if (shadow_underlay_in_surface_) { | 1532 if (shadow_underlay_in_surface_) { |
| 1531 shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size()); | 1533 shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size()); |
| 1532 } else { | 1534 } else { |
| 1533 gfx::Point origin; | 1535 gfx::Point origin; |
| 1534 origin -= window->bounds().origin().OffsetFromOrigin(); | 1536 origin -= window->bounds().origin().OffsetFromOrigin(); |
| 1535 shadow_bounds.set_origin(origin); | 1537 shadow_bounds.set_origin(origin); |
| 1536 shadow_bounds.set_size(window->parent()->bounds().size()); | 1538 shadow_bounds.set_size(window->parent()->bounds().size()); |
| 1537 } | 1539 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 // small style shadow for them. | 1587 // small style shadow for them. |
| 1586 if (!activatable_) | 1588 if (!activatable_) |
| 1587 shadow->SetElevation(wm::ShadowElevation::SMALL); | 1589 shadow->SetElevation(wm::ShadowElevation::SMALL); |
| 1588 // We don't have rounded corners unless frame is enabled. | 1590 // We don't have rounded corners unless frame is enabled. |
| 1589 if (!frame_enabled_) | 1591 if (!frame_enabled_) |
| 1590 shadow->SetRoundedCornerRadius(0); | 1592 shadow->SetRoundedCornerRadius(0); |
| 1591 } | 1593 } |
| 1592 } | 1594 } |
| 1593 | 1595 |
| 1594 } // namespace exo | 1596 } // namespace exo |
| OLD | NEW |