OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/window_manager.h" | 5 #include "ash/mus/window_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 void WindowManager::OnEmbed(ui::Window* root) { | 207 void WindowManager::OnEmbed(ui::Window* root) { |
208 // WindowManager should never see this, instead OnWmNewDisplay() is called. | 208 // WindowManager should never see this, instead OnWmNewDisplay() is called. |
209 NOTREACHED(); | 209 NOTREACHED(); |
210 } | 210 } |
211 | 211 |
212 void WindowManager::OnDidDestroyClient(ui::WindowTreeClient* client) { | 212 void WindowManager::OnDidDestroyClient(ui::WindowTreeClient* client) { |
213 // Destroying the roots should result in removal from | 213 // Destroying the roots should result in removal from |
214 // |root_window_controllers_|. | 214 // |root_window_controllers_|. |
215 DCHECK(root_window_controllers_.empty()); | 215 DCHECK(root_window_controllers_.empty()); |
216 | 216 |
217 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, | |
James Cook
2016/08/22 15:46:40
Can you add a comment here saying this must be des
sadrul
2016/08/22 15:52:20
Done. I looked into writing a unit-test for this,
| |
218 OnWindowTreeClientDestroyed()); | |
219 | |
217 lookup_.reset(); | 220 lookup_.reset(); |
218 shell_->Shutdown(); | 221 shell_->Shutdown(); |
219 shell_.reset(); | 222 shell_.reset(); |
220 shadow_controller_.reset(); | 223 shadow_controller_.reset(); |
221 | 224 |
222 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, | |
223 OnWindowTreeClientDestroyed()); | |
224 | |
225 pointer_watcher_event_router_.reset(); | 225 pointer_watcher_event_router_.reset(); |
226 | 226 |
227 window_tree_client_ = nullptr; | 227 window_tree_client_ = nullptr; |
228 window_manager_client_ = nullptr; | 228 window_manager_client_ = nullptr; |
229 } | 229 } |
230 | 230 |
231 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event, | 231 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event, |
232 ui::Window* target) { | 232 ui::Window* target) { |
233 pointer_watcher_event_router_->OnPointerEventObserved(event, target); | 233 pointer_watcher_event_router_->OnPointerEventObserved(event, target); |
234 } | 234 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 const ui::Event& event) { | 306 const ui::Event& event) { |
307 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); | 307 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); |
308 if (iter == accelerator_handlers_.end()) | 308 if (iter == accelerator_handlers_.end()) |
309 return ui::mojom::EventResult::HANDLED; | 309 return ui::mojom::EventResult::HANDLED; |
310 | 310 |
311 return iter->second->OnAccelerator(id, event); | 311 return iter->second->OnAccelerator(id, event); |
312 } | 312 } |
313 | 313 |
314 } // namespace mus | 314 } // namespace mus |
315 } // namespace ash | 315 } // namespace ash |
OLD | NEW |