| 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/wm/aura/wm_window_aura.h" | 5 #include "ash/wm/aura/wm_window_aura.h" |
| 6 | 6 |
| 7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shelf/shelf_util.h" | 8 #include "ash/shelf/shelf_util.h" |
| 9 #include "ash/wm/aura/aura_layout_manager_adapter.h" | 9 #include "ash/wm/aura/aura_layout_manager_adapter.h" |
| 10 #include "ash/wm/aura/wm_globals_aura.h" | 10 #include "ash/wm/aura/wm_globals_aura.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 void WmWindowAura::SetBoundsDirectCrossFade(const gfx::Rect& bounds) { | 308 void WmWindowAura::SetBoundsDirectCrossFade(const gfx::Rect& bounds) { |
| 309 const gfx::Rect old_bounds = window_->bounds(); | 309 const gfx::Rect old_bounds = window_->bounds(); |
| 310 | 310 |
| 311 // Create fresh layers for the window and all its children to paint into. | 311 // Create fresh layers for the window and all its children to paint into. |
| 312 // Takes ownership of the old layer and all its children, which will be | 312 // Takes ownership of the old layer and all its children, which will be |
| 313 // cleaned up after the animation completes. | 313 // cleaned up after the animation completes. |
| 314 // Specify |set_bounds| to true here to keep the old bounds in the child | 314 // Specify |set_bounds| to true here to keep the old bounds in the child |
| 315 // windows of |window|. | 315 // windows of |window|. |
| 316 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner = | 316 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner = |
| 317 ::wm::RecreateLayers(window_); | 317 ::wm::RecreateLayers(window_, nullptr); |
| 318 ui::Layer* old_layer = old_layer_owner->root(); | 318 ui::Layer* old_layer = old_layer_owner->root(); |
| 319 DCHECK(old_layer); | 319 DCHECK(old_layer); |
| 320 ui::Layer* new_layer = window_->layer(); | 320 ui::Layer* new_layer = window_->layer(); |
| 321 | 321 |
| 322 // Resize the window to the new size, which will force a layout and paint. | 322 // Resize the window to the new size, which will force a layout and paint. |
| 323 SetBoundsDirect(bounds); | 323 SetBoundsDirect(bounds); |
| 324 | 324 |
| 325 // Ensure the higher-resolution layer is on top. | 325 // Ensure the higher-resolution layer is on top. |
| 326 bool old_on_top = (old_bounds.width() > bounds.width()); | 326 bool old_on_top = (old_bounds.width() > bounds.width()); |
| 327 if (old_on_top) | 327 if (old_on_top) |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 556 } |
| 557 | 557 |
| 558 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, | 558 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, |
| 559 bool visible) { | 559 bool visible) { |
| 560 FOR_EACH_OBSERVER(WmWindowObserver, observers_, | 560 FOR_EACH_OBSERVER(WmWindowObserver, observers_, |
| 561 OnWindowVisibilityChanging(this, visible)); | 561 OnWindowVisibilityChanging(this, visible)); |
| 562 } | 562 } |
| 563 | 563 |
| 564 } // namespace wm | 564 } // namespace wm |
| 565 } // namespace ash | 565 } // namespace ash |
| OLD | NEW |