| 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_globals_mus.h" | 5 #include "ash/mus/bridge/wm_globals_mus.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
| 8 #include "ash/common/wm/window_resizer.h" | 8 #include "ash/common/wm/window_resizer.h" |
| 9 #include "ash/common/wm/wm_activation_observer.h" | 9 #include "ash/common/wm/wm_activation_observer.h" |
| 10 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 10 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 void WmGlobalsMus::RemoveOverviewModeObserver( | 180 void WmGlobalsMus::RemoveOverviewModeObserver( |
| 181 wm::WmOverviewModeObserver* observer) { | 181 wm::WmOverviewModeObserver* observer) { |
| 182 NOTIMPLEMENTED(); | 182 NOTIMPLEMENTED(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 // static | 185 // static |
| 186 bool WmGlobalsMus::IsActivationParent(::mus::Window* window) { | 186 bool WmGlobalsMus::IsActivationParent(::mus::Window* window) { |
| 187 if (!window) | 187 if (!window) |
| 188 return false; | 188 return false; |
| 189 | 189 |
| 190 const int shell_window_id = WmWindowMus::Get(window)->GetShellWindowId(); |
| 190 for (size_t i = 0; i < kNumActivationContainers; ++i) { | 191 for (size_t i = 0; i < kNumActivationContainers; ++i) { |
| 191 if (window->local_id() == static_cast<int>(kActivationContainers[i])) | 192 if (shell_window_id == kActivationContainers[i]) |
| 192 return true; | 193 return true; |
| 193 } | 194 } |
| 194 return false; | 195 return false; |
| 195 } | 196 } |
| 196 | 197 |
| 197 void WmGlobalsMus::RemoveClientObserver() { | 198 void WmGlobalsMus::RemoveClientObserver() { |
| 198 if (!client_) | 199 if (!client_) |
| 199 return; | 200 return; |
| 200 | 201 |
| 201 client_->RemoveObserver(this); | 202 client_->RemoveObserver(this); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 214 OnWindowActivated(gained_active, lost_active)); | 215 OnWindowActivated(gained_active, lost_active)); |
| 215 } | 216 } |
| 216 | 217 |
| 217 void WmGlobalsMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { | 218 void WmGlobalsMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { |
| 218 DCHECK_EQ(client, client_); | 219 DCHECK_EQ(client, client_); |
| 219 RemoveClientObserver(); | 220 RemoveClientObserver(); |
| 220 } | 221 } |
| 221 | 222 |
| 222 } // namespace mus | 223 } // namespace mus |
| 223 } // namespace ash | 224 } // namespace ash |
| OLD | NEW |