| 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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 gfx::Rect client_view_bounds = | 1411 gfx::Rect client_view_bounds = |
| 1412 widget_->non_client_view()->frame_view()->GetBoundsForClientView(); | 1412 widget_->non_client_view()->frame_view()->GetBoundsForClientView(); |
| 1413 | 1413 |
| 1414 // A change to the widget size requires surface bounds to be re-adjusted. | 1414 // A change to the widget size requires surface bounds to be re-adjusted. |
| 1415 surface_->window()->SetBounds( | 1415 surface_->window()->SetBounds( |
| 1416 gfx::Rect(GetSurfaceOrigin() + client_view_bounds.OffsetFromOrigin(), | 1416 gfx::Rect(GetSurfaceOrigin() + client_view_bounds.OffsetFromOrigin(), |
| 1417 surface_->window()->layer()->size())); | 1417 surface_->window()->layer()->size())); |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 void ShellSurface::UpdateShadow() { | 1420 void ShellSurface::UpdateShadow() { |
| 1421 if (!widget_) | 1421 if (!widget_ || !surface_) |
| 1422 return; | 1422 return; |
| 1423 aura::Window* window = widget_->GetNativeWindow(); | 1423 aura::Window* window = widget_->GetNativeWindow(); |
| 1424 if (!shadow_enabled_) { | 1424 if (!shadow_enabled_) { |
| 1425 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); | 1425 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); |
| 1426 if (shadow_underlay_) | 1426 if (shadow_underlay_) |
| 1427 shadow_underlay_->Hide(); | 1427 shadow_underlay_->Hide(); |
| 1428 } else { | 1428 } else { |
| 1429 wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM); | 1429 wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM); |
| 1430 gfx::Rect shadow_content_bounds = | 1430 gfx::Rect shadow_content_bounds = |
| 1431 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); | 1431 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 // small style shadow for them. | 1543 // small style shadow for them. |
| 1544 if (!activatable_) | 1544 if (!activatable_) |
| 1545 shadow->SetElevation(wm::ShadowElevation::SMALL); | 1545 shadow->SetElevation(wm::ShadowElevation::SMALL); |
| 1546 // We don't have rounded corners unless frame is enabled. | 1546 // We don't have rounded corners unless frame is enabled. |
| 1547 if (!frame_enabled_) | 1547 if (!frame_enabled_) |
| 1548 shadow->SetRoundedCornerRadius(0); | 1548 shadow->SetRoundedCornerRadius(0); |
| 1549 } | 1549 } |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 } // namespace exo | 1552 } // namespace exo |
| OLD | NEW |