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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 void WmWindowAura::SetBoundsDirectCrossFade(const gfx::Rect& bounds) { | 492 void WmWindowAura::SetBoundsDirectCrossFade(const gfx::Rect& bounds) { |
493 const gfx::Rect old_bounds = window_->bounds(); | 493 const gfx::Rect old_bounds = window_->bounds(); |
494 | 494 |
495 // Create fresh layers for the window and all its children to paint into. | 495 // Create fresh layers for the window and all its children to paint into. |
496 // Takes ownership of the old layer and all its children, which will be | 496 // Takes ownership of the old layer and all its children, which will be |
497 // cleaned up after the animation completes. | 497 // cleaned up after the animation completes. |
498 // Specify |set_bounds| to true here to keep the old bounds in the child | 498 // Specify |set_bounds| to true here to keep the old bounds in the child |
499 // windows of |window|. | 499 // windows of |window|. |
500 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner = | 500 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner = |
501 ::wm::RecreateLayers(window_, nullptr); | 501 ::wm::RecreateLayers(window_); |
502 ui::Layer* old_layer = old_layer_owner->root(); | 502 ui::Layer* old_layer = old_layer_owner->root(); |
503 DCHECK(old_layer); | 503 DCHECK(old_layer); |
504 ui::Layer* new_layer = window_->layer(); | 504 ui::Layer* new_layer = window_->layer(); |
505 | 505 |
506 // Resize the window to the new size, which will force a layout and paint. | 506 // Resize the window to the new size, which will force a layout and paint. |
507 SetBoundsDirect(bounds); | 507 SetBoundsDirect(bounds); |
508 | 508 |
509 // Ensure the higher-resolution layer is on top. | 509 // Ensure the higher-resolution layer is on top. |
510 bool old_on_top = (old_bounds.width() > bounds.width()); | 510 bool old_on_top = (old_bounds.width() > bounds.width()); |
511 if (old_on_top) | 511 if (old_on_top) |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 OnTransientChildAdded(this, Get(transient))); | 898 OnTransientChildAdded(this, Get(transient))); |
899 } | 899 } |
900 | 900 |
901 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 901 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
902 aura::Window* transient) { | 902 aura::Window* transient) { |
903 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, | 903 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, |
904 OnTransientChildRemoved(this, Get(transient))); | 904 OnTransientChildRemoved(this, Get(transient))); |
905 } | 905 } |
906 | 906 |
907 } // namespace ash | 907 } // namespace ash |
OLD | NEW |