| 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/wm_window_mus.h" | 5 #include "mash/wm/bridge/wm_window_mus.h" |
| 6 | 6 |
| 7 #include "ash/wm/common/container_finder.h" | 7 #include "ash/wm/common/container_finder.h" |
| 8 #include "ash/wm/common/window_state.h" | 8 #include "ash/wm/common/window_state.h" |
| 9 #include "ash/wm/common/wm_layout_manager.h" | 9 #include "ash/wm/common/wm_layout_manager.h" |
| 10 #include "ash/wm/common/wm_window_observer.h" | 10 #include "ash/wm/common/wm_window_observer.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 case ui::SHOW_STATE_DOCKED: | 84 case ui::SHOW_STATE_DOCKED: |
| 85 return mus::mojom::ShowState::DOCKED; | 85 return mus::mojom::ShowState::DOCKED; |
| 86 default: | 86 default: |
| 87 break; | 87 break; |
| 88 } | 88 } |
| 89 return mus::mojom::ShowState::DEFAULT; | 89 return mus::mojom::ShowState::DEFAULT; |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| 93 | 93 |
| 94 WmWindowMus::WmWindowMus(mus::Window* window) : window_(window) { | 94 WmWindowMus::WmWindowMus(mus::Window* window) |
| 95 : window_(window), |
| 96 // Matches aura, see aura::Window for details. |
| 97 observers_( |
| 98 base::ObserverList<ash::wm::WmWindowObserver>::NOTIFY_EXISTING_ONLY) { |
| 95 window_->AddObserver(this); | 99 window_->AddObserver(this); |
| 96 window_->SetLocalProperty(kWmWindowKey, this); | 100 window_->SetLocalProperty(kWmWindowKey, this); |
| 97 window_state_.reset(new WindowStateMus(this)); | 101 window_state_.reset(new WindowStateMus(this)); |
| 98 } | 102 } |
| 99 | 103 |
| 100 WmWindowMus::~WmWindowMus() { | 104 WmWindowMus::~WmWindowMus() { |
| 101 window_->RemoveObserver(this); | 105 window_->RemoveObserver(this); |
| 102 } | 106 } |
| 103 | 107 |
| 104 // static | 108 // static |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 OnWindowBoundsChanged(this, old_bounds, new_bounds)); | 597 OnWindowBoundsChanged(this, old_bounds, new_bounds)); |
| 594 } | 598 } |
| 595 | 599 |
| 596 void WmWindowMus::OnWindowDestroying(mus::Window* window) { | 600 void WmWindowMus::OnWindowDestroying(mus::Window* window) { |
| 597 FOR_EACH_OBSERVER(ash::wm::WmWindowObserver, observers_, | 601 FOR_EACH_OBSERVER(ash::wm::WmWindowObserver, observers_, |
| 598 OnWindowDestroying(this)); | 602 OnWindowDestroying(this)); |
| 599 } | 603 } |
| 600 | 604 |
| 601 } // namespace wm | 605 } // namespace wm |
| 602 } // namespace mash | 606 } // namespace mash |
| OLD | NEW |