| 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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 gfx::Rect client_view_bounds = | 1408 gfx::Rect client_view_bounds = |
| 1409 widget_->non_client_view()->frame_view()->GetBoundsForClientView(); | 1409 widget_->non_client_view()->frame_view()->GetBoundsForClientView(); |
| 1410 | 1410 |
| 1411 // A change to the widget size requires surface bounds to be re-adjusted. | 1411 // A change to the widget size requires surface bounds to be re-adjusted. |
| 1412 surface_->window()->SetBounds( | 1412 surface_->window()->SetBounds( |
| 1413 gfx::Rect(GetSurfaceOrigin() + client_view_bounds.OffsetFromOrigin(), | 1413 gfx::Rect(GetSurfaceOrigin() + client_view_bounds.OffsetFromOrigin(), |
| 1414 surface_->window()->layer()->size())); | 1414 surface_->window()->layer()->size())); |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 void ShellSurface::UpdateShadow() { | 1417 void ShellSurface::UpdateShadow() { |
| 1418 if (!widget_) | 1418 if (!widget_ || !surface_) |
| 1419 return; | 1419 return; |
| 1420 aura::Window* window = widget_->GetNativeWindow(); | 1420 aura::Window* window = widget_->GetNativeWindow(); |
| 1421 if (!shadow_enabled_) { | 1421 if (!shadow_enabled_) { |
| 1422 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); | 1422 wm::SetShadowElevation(window, wm::ShadowElevation::NONE); |
| 1423 if (shadow_underlay_) | 1423 if (shadow_underlay_) |
| 1424 shadow_underlay_->Hide(); | 1424 shadow_underlay_->Hide(); |
| 1425 } else { | 1425 } else { |
| 1426 wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM); | 1426 wm::SetShadowElevation(window, wm::ShadowElevation::MEDIUM); |
| 1427 gfx::Rect shadow_content_bounds = | 1427 gfx::Rect shadow_content_bounds = |
| 1428 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); | 1428 gfx::ScaleToEnclosedRect(shadow_content_bounds_, 1.f / scale_); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 shadow_overlay_->SetBounds(shadow_bounds); | 1534 shadow_overlay_->SetBounds(shadow_bounds); |
| 1535 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1535 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1536 // Surfaces that can't be activated are usually menus and tooltips. Use a | 1536 // Surfaces that can't be activated are usually menus and tooltips. Use a |
| 1537 // small style shadow for them. | 1537 // small style shadow for them. |
| 1538 if (!activatable_) | 1538 if (!activatable_) |
| 1539 shadow->SetElevation(wm::ShadowElevation::SMALL); | 1539 shadow->SetElevation(wm::ShadowElevation::SMALL); |
| 1540 } | 1540 } |
| 1541 } | 1541 } |
| 1542 | 1542 |
| 1543 } // namespace exo | 1543 } // namespace exo |
| OLD | NEW |