| 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_shell_mus.h" | 5 #include "ash/mus/bridge/wm_shell_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_activation_observer.h" | 9 #include "ash/common/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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 void WmShellMus::RemoveOverviewModeObserver(WmOverviewModeObserver* observer) { | 178 void WmShellMus::RemoveOverviewModeObserver(WmOverviewModeObserver* observer) { |
| 179 NOTIMPLEMENTED(); | 179 NOTIMPLEMENTED(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 // static | 182 // static |
| 183 bool WmShellMus::IsActivationParent(::mus::Window* window) { | 183 bool WmShellMus::IsActivationParent(::mus::Window* window) { |
| 184 if (!window) | 184 if (!window) |
| 185 return false; | 185 return false; |
| 186 | 186 |
| 187 for (size_t i = 0; i < kNumActivationContainers; ++i) { | 187 const int shell_window_id = WmWindowMus::Get(window)->GetShellWindowId(); |
| 188 if (window->local_id() == static_cast<int>(kActivationContainers[i])) | 188 for (size_t i = 0; i < kNumActivatableShellWindowIds; ++i) { |
| 189 if (shell_window_id == kActivatableShellWindowIds[i]) |
| 189 return true; | 190 return true; |
| 190 } | 191 } |
| 191 return false; | 192 return false; |
| 192 } | 193 } |
| 193 | 194 |
| 194 void WmShellMus::RemoveClientObserver() { | 195 void WmShellMus::RemoveClientObserver() { |
| 195 if (!client_) | 196 if (!client_) |
| 196 return; | 197 return; |
| 197 | 198 |
| 198 client_->RemoveObserver(this); | 199 client_->RemoveObserver(this); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 211 OnWindowActivated(gained_active, lost_active)); | 212 OnWindowActivated(gained_active, lost_active)); |
| 212 } | 213 } |
| 213 | 214 |
| 214 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { | 215 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { |
| 215 DCHECK_EQ(client, client_); | 216 DCHECK_EQ(client, client_); |
| 216 RemoveClientObserver(); | 217 RemoveClientObserver(); |
| 217 } | 218 } |
| 218 | 219 |
| 219 } // namespace mus | 220 } // namespace mus |
| 220 } // namespace ash | 221 } // namespace ash |
| OLD | NEW |