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/mus/bridge/wm_window_mus.h" | 5 #include "ash/mus/bridge/wm_window_mus.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/shelf_item_types.h" | 7 #include "ash/common/shelf/shelf_item_types.h" |
| 8 #include "ash/common/wm/container_finder.h" | 8 #include "ash/common/wm/container_finder.h" |
| 9 #include "ash/common/wm/window_positioning_utils.h" | 9 #include "ash/common/wm/window_positioning_utils.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 } | 126 } |
| 127 | 127 |
| 128 WmWindowMus::~WmWindowMus() { | 128 WmWindowMus::~WmWindowMus() { |
| 129 window_->RemoveObserver(this); | 129 window_->RemoveObserver(this); |
| 130 } | 130 } |
| 131 | 131 |
| 132 // static | 132 // static |
| 133 const WmWindowMus* WmWindowMus::Get(const ui::Window* window) { | 133 const WmWindowMus* WmWindowMus::Get(const ui::Window* window) { |
| 134 if (!window) | 134 if (!window) |
| 135 return nullptr; | 135 return nullptr; |
| 136 | |
|
mfomitchev
2016/11/17 17:14:01
Doesn't seem like there's particular reason to rem
thanhph
2016/11/17 19:08:30
Done.
| |
| 137 const WmWindowMus* wm_window = window->GetLocalProperty(kWmWindowKey); | 136 const WmWindowMus* wm_window = window->GetLocalProperty(kWmWindowKey); |
| 138 if (wm_window) | 137 if (wm_window) |
| 139 return wm_window; | 138 return wm_window; |
| 140 // WmWindowMus is owned by the ui::Window. | 139 // WmWindowMus is owned by the ui::Window. |
| 141 // Unfortunately there isn't a good way to avoid the cast here. | 140 // Unfortunately there isn't a good way to avoid the cast here. |
| 142 return new WmWindowMus(const_cast<ui::Window*>(window)); | 141 return new WmWindowMus(const_cast<ui::Window*>(window)); |
| 143 } | 142 } |
| 144 | 143 |
| 145 // static | 144 // static |
| 146 WmWindowMus* WmWindowMus::Get(views::Widget* widget) { | 145 WmWindowMus* WmWindowMus::Get(views::Widget* widget) { |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1063 } | 1062 } |
| 1064 | 1063 |
| 1065 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, | 1064 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, |
| 1066 ui::Window* transient) { | 1065 ui::Window* transient) { |
| 1067 for (auto& observer : transient_observers_) | 1066 for (auto& observer : transient_observers_) |
| 1068 observer.OnTransientChildRemoved(this, Get(transient)); | 1067 observer.OnTransientChildRemoved(this, Get(transient)); |
| 1069 } | 1068 } |
| 1070 | 1069 |
| 1071 } // namespace mus | 1070 } // namespace mus |
| 1072 } // namespace ash | 1071 } // namespace ash |
| OLD | NEW |