| 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 "mash/wm/bridge/mus_layout_manager_adapter.h" | 5 #include "mash/wm/bridge/mus_layout_manager_adapter.h" |
| 6 | 6 |
| 7 #include "ash/wm/common/wm_layout_manager.h" | 7 #include "ash/wm/common/wm_layout_manager.h" |
| 8 #include "components/mus/public/cpp/window.h" | 8 #include "components/mus/public/cpp/window.h" |
| 9 #include "mash/wm/bridge/wm_window_mus.h" | 9 #include "mash/wm/bridge/wm_window_mus.h" |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 void MusLayoutManagerAdapter::OnTreeChanging(const TreeChangeParams& params) { | 44 void MusLayoutManagerAdapter::OnTreeChanging(const TreeChangeParams& params) { |
| 45 if (params.old_parent == window_) { | 45 if (params.old_parent == window_) { |
| 46 layout_manager_->OnWillRemoveWindowFromLayout( | 46 layout_manager_->OnWillRemoveWindowFromLayout( |
| 47 WmWindowMus::Get(params.target)); | 47 WmWindowMus::Get(params.target)); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 void MusLayoutManagerAdapter::OnTreeChanged(const TreeChangeParams& params) { | 51 void MusLayoutManagerAdapter::OnTreeChanged(const TreeChangeParams& params) { |
| 52 if (params.new_parent == window_) { | 52 if (params.new_parent == window_) { |
| 53 layout_manager_->OnWindowAddedToLayout(WmWindowMus::Get(params.target)); | 53 layout_manager_->OnWindowAddedToLayout(WmWindowMus::Get(params.target)); |
| 54 params.target->AddObserver(&child_window_observer_); |
| 54 } else if (params.old_parent == window_) { | 55 } else if (params.old_parent == window_) { |
| 55 params.target->RemoveObserver(&child_window_observer_); | 56 params.target->RemoveObserver(&child_window_observer_); |
| 56 layout_manager_->OnWindowRemovedFromLayout(WmWindowMus::Get(params.target)); | 57 layout_manager_->OnWindowRemovedFromLayout(WmWindowMus::Get(params.target)); |
| 57 } | 58 } |
| 58 } | 59 } |
| 59 | 60 |
| 60 void MusLayoutManagerAdapter::OnWindowBoundsChanged( | 61 void MusLayoutManagerAdapter::OnWindowBoundsChanged( |
| 61 mus::Window* window, | 62 mus::Window* window, |
| 62 const gfx::Rect& old_bounds, | 63 const gfx::Rect& old_bounds, |
| 63 const gfx::Rect& new_bounds) { | 64 const gfx::Rect& new_bounds) { |
| 64 layout_manager_->OnWindowResized(); | 65 layout_manager_->OnWindowResized(); |
| 65 } | 66 } |
| 66 | 67 |
| 67 } // namespace wm | 68 } // namespace wm |
| 68 } // namespace mash | 69 } // namespace mash |
| OLD | NEW |