Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/aura/wm_window_aura.h" | 5 #include "ash/aura/wm_window_aura.h" |
| 6 | 6 |
| 7 #include "ash/aura/aura_layout_manager_adapter.h" | 7 #include "ash/aura/aura_layout_manager_adapter.h" |
| 8 #include "ash/aura/wm_root_window_controller_aura.h" | 8 #include "ash/aura/wm_root_window_controller_aura.h" |
| 9 #include "ash/aura/wm_shell_aura.h" | 9 #include "ash/aura/wm_shell_aura.h" |
| 10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 result[i] = WmWindowAura::GetAuraWindow(windows[i]); | 128 result[i] = WmWindowAura::GetAuraWindow(windows[i]); |
| 129 return result; | 129 return result; |
| 130 } | 130 } |
| 131 | 131 |
| 132 // static | 132 // static |
| 133 const aura::Window* WmWindowAura::GetAuraWindow(const WmWindow* wm_window) { | 133 const aura::Window* WmWindowAura::GetAuraWindow(const WmWindow* wm_window) { |
| 134 return wm_window ? static_cast<const WmWindowAura*>(wm_window)->aura_window() | 134 return wm_window ? static_cast<const WmWindowAura*>(wm_window)->aura_window() |
| 135 : nullptr; | 135 : nullptr; |
| 136 } | 136 } |
| 137 | 137 |
| 138 void WmWindowAura::Destroy() { | |
| 139 delete window_; | |
| 140 } | |
|
James Cook
2016/09/09 21:33:36
set window_ = nullptr here?
sky
2016/09/09 21:50:45
'this' should be deleted as a result of delete win
| |
| 141 | |
| 138 const WmWindow* WmWindowAura::GetRootWindow() const { | 142 const WmWindow* WmWindowAura::GetRootWindow() const { |
| 139 return Get(window_->GetRootWindow()); | 143 return Get(window_->GetRootWindow()); |
| 140 } | 144 } |
| 141 | 145 |
| 142 WmRootWindowController* WmWindowAura::GetRootWindowController() { | 146 WmRootWindowController* WmWindowAura::GetRootWindowController() { |
| 143 aura::Window* root = window_->GetRootWindow(); | 147 aura::Window* root = window_->GetRootWindow(); |
| 144 return root ? WmRootWindowControllerAura::Get(root) : nullptr; | 148 return root ? WmRootWindowControllerAura::Get(root) : nullptr; |
| 145 } | 149 } |
| 146 | 150 |
| 147 WmShell* WmWindowAura::GetShell() const { | 151 WmShell* WmWindowAura::GetShell() const { |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 layout_manager ? new AuraLayoutManagerAdapter(std::move(layout_manager)) | 362 layout_manager ? new AuraLayoutManagerAdapter(std::move(layout_manager)) |
| 359 : nullptr); | 363 : nullptr); |
| 360 } | 364 } |
| 361 | 365 |
| 362 WmLayoutManager* WmWindowAura::GetLayoutManager() { | 366 WmLayoutManager* WmWindowAura::GetLayoutManager() { |
| 363 AuraLayoutManagerAdapter* adapter = | 367 AuraLayoutManagerAdapter* adapter = |
| 364 static_cast<AuraLayoutManagerAdapter*>(window_->layout_manager()); | 368 static_cast<AuraLayoutManagerAdapter*>(window_->layout_manager()); |
| 365 return adapter ? adapter->wm_layout_manager() : nullptr; | 369 return adapter ? adapter->wm_layout_manager() : nullptr; |
| 366 } | 370 } |
| 367 | 371 |
| 372 void WmWindowAura::SetVisibilityChangesAnimated() { | |
| 373 ::wm::SetWindowVisibilityChangesAnimated(window_); | |
| 374 } | |
| 375 | |
| 368 void WmWindowAura::SetVisibilityAnimationType(int type) { | 376 void WmWindowAura::SetVisibilityAnimationType(int type) { |
| 369 ::wm::SetWindowVisibilityAnimationType(window_, type); | 377 ::wm::SetWindowVisibilityAnimationType(window_, type); |
| 370 } | 378 } |
| 371 | 379 |
| 372 void WmWindowAura::SetVisibilityAnimationDuration(base::TimeDelta delta) { | 380 void WmWindowAura::SetVisibilityAnimationDuration(base::TimeDelta delta) { |
| 373 ::wm::SetWindowVisibilityAnimationDuration(window_, delta); | 381 ::wm::SetWindowVisibilityAnimationDuration(window_, delta); |
| 374 } | 382 } |
| 375 | 383 |
| 376 void WmWindowAura::SetVisibilityAnimationTransition( | 384 void WmWindowAura::SetVisibilityAnimationTransition( |
| 377 ::wm::WindowVisibilityAnimationTransition transition) { | 385 ::wm::WindowVisibilityAnimationTransition transition) { |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 824 OnTransientChildAdded(this, Get(transient))); | 832 OnTransientChildAdded(this, Get(transient))); |
| 825 } | 833 } |
| 826 | 834 |
| 827 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 835 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
| 828 aura::Window* transient) { | 836 aura::Window* transient) { |
| 829 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, | 837 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, |
| 830 OnTransientChildRemoved(this, Get(transient))); | 838 OnTransientChildRemoved(this, Get(transient))); |
| 831 } | 839 } |
| 832 | 840 |
| 833 } // namespace ash | 841 } // namespace ash |
| OLD | NEW |