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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 ash::kShellWindowId_DefaultContainer) {} | 322 ash::kShellWindowId_DefaultContainer) {} |
323 | 323 |
324 ShellSurface::~ShellSurface() { | 324 ShellSurface::~ShellSurface() { |
325 DCHECK(!scoped_configure_); | 325 DCHECK(!scoped_configure_); |
326 if (resizer_) | 326 if (resizer_) |
327 EndDrag(false /* revert */); | 327 EndDrag(false /* revert */); |
328 if (widget_) { | 328 if (widget_) { |
329 ash::wm::GetWindowState(widget_->GetNativeWindow())->RemoveObserver(this); | 329 ash::wm::GetWindowState(widget_->GetNativeWindow())->RemoveObserver(this); |
330 widget_->GetNativeWindow()->RemoveObserver(this); | 330 widget_->GetNativeWindow()->RemoveObserver(this); |
331 // Remove transient children so they are not automatically destroyed. | 331 // Remove transient children so they are not automatically destroyed. |
332 for (auto child : wm::GetTransientChildren(widget_->GetNativeWindow())) | 332 for (auto* child : wm::GetTransientChildren(widget_->GetNativeWindow())) |
333 wm::RemoveTransientChild(widget_->GetNativeWindow(), child); | 333 wm::RemoveTransientChild(widget_->GetNativeWindow(), child); |
334 if (widget_->IsVisible()) | 334 if (widget_->IsVisible()) |
335 widget_->Hide(); | 335 widget_->Hide(); |
336 widget_->CloseNow(); | 336 widget_->CloseNow(); |
337 } | 337 } |
338 WMHelper::GetInstance()->RemoveActivationObserver(this); | 338 WMHelper::GetInstance()->RemoveActivationObserver(this); |
339 if (parent_) | 339 if (parent_) |
340 parent_->RemoveObserver(this); | 340 parent_->RemoveObserver(this); |
341 if (surface_) { | 341 if (surface_) { |
342 if (scale_ != 1.0) | 342 if (scale_ != 1.0) |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 EndDrag(false /* revert */); | 783 EndDrag(false /* revert */); |
784 if (widget_) | 784 if (widget_) |
785 SetMainSurface(widget_->GetNativeWindow(), nullptr); | 785 SetMainSurface(widget_->GetNativeWindow(), nullptr); |
786 surface->RemoveSurfaceObserver(this); | 786 surface->RemoveSurfaceObserver(this); |
787 surface_ = nullptr; | 787 surface_ = nullptr; |
788 | 788 |
789 // Hide widget before surface is destroyed. This allows hide animations to | 789 // Hide widget before surface is destroyed. This allows hide animations to |
790 // run using the current surface contents. | 790 // run using the current surface contents. |
791 if (widget_) { | 791 if (widget_) { |
792 // Remove transient children so they are not automatically hidden. | 792 // Remove transient children so they are not automatically hidden. |
793 for (auto child : wm::GetTransientChildren(widget_->GetNativeWindow())) | 793 for (auto* child : wm::GetTransientChildren(widget_->GetNativeWindow())) |
794 wm::RemoveTransientChild(widget_->GetNativeWindow(), child); | 794 wm::RemoveTransientChild(widget_->GetNativeWindow(), child); |
795 widget_->Hide(); | 795 widget_->Hide(); |
796 } | 796 } |
797 | 797 |
798 // Note: In its use in the Wayland server implementation, the surface | 798 // Note: In its use in the Wayland server implementation, the surface |
799 // destroyed callback may destroy the ShellSurface instance. This call needs | 799 // destroyed callback may destroy the ShellSurface instance. This call needs |
800 // to be last so that the instance can be destroyed. | 800 // to be last so that the instance can be destroyed. |
801 if (!surface_destroyed_callback_.is_null()) | 801 if (!surface_destroyed_callback_.is_null()) |
802 surface_destroyed_callback_.Run(); | 802 surface_destroyed_callback_.Run(); |
803 } | 803 } |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 // small style shadow for them. | 1570 // small style shadow for them. |
1571 if (!activatable_) | 1571 if (!activatable_) |
1572 shadow->SetElevation(wm::ShadowElevation::SMALL); | 1572 shadow->SetElevation(wm::ShadowElevation::SMALL); |
1573 // We don't have rounded corners unless frame is enabled. | 1573 // We don't have rounded corners unless frame is enabled. |
1574 if (!frame_enabled_) | 1574 if (!frame_enabled_) |
1575 shadow->SetRoundedCornerRadius(0); | 1575 shadow->SetRoundedCornerRadius(0); |
1576 } | 1576 } |
1577 } | 1577 } |
1578 | 1578 |
1579 } // namespace exo | 1579 } // namespace exo |
OLD | NEW |