| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // client has been set. | 148 // client has been set. |
| 149 aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); | 149 aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); |
| 150 pointer_watcher_event_router_->AttachToCaptureClient(capture_client); | 150 pointer_watcher_event_router_->AttachToCaptureClient(capture_client); |
| 151 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( | 151 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( |
| 152 capture_client); | 152 capture_client); |
| 153 | 153 |
| 154 if (shell_delegate) | 154 if (shell_delegate) |
| 155 shell_delegate_ = std::move(shell_delegate); | 155 shell_delegate_ = std::move(shell_delegate); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void WindowManager::SetLostConnectionCallback(base::OnceClosure closure) { |
| 159 lost_connection_callback_ = std::move(closure); |
| 160 } |
| 161 |
| 158 bool WindowManager::WaitForInitialDisplays() { | 162 bool WindowManager::WaitForInitialDisplays() { |
| 159 return window_manager_client_->WaitForInitialDisplays(); | 163 return window_manager_client_->WaitForInitialDisplays(); |
| 160 } | 164 } |
| 161 | 165 |
| 162 void WindowManager::DeleteAllRootWindowControllers() { | 166 void WindowManager::DeleteAllRootWindowControllers() { |
| 163 // Primary RootWindowController must be destroyed last. | 167 // Primary RootWindowController must be destroyed last. |
| 164 RootWindowController* primary_root_window_controller = | 168 RootWindowController* primary_root_window_controller = |
| 165 GetPrimaryRootWindowController(); | 169 GetPrimaryRootWindowController(); |
| 166 std::set<RootWindowController*> secondary_root_window_controllers; | 170 std::set<RootWindowController*> secondary_root_window_controllers; |
| 167 for (auto& root_window_controller_ptr : root_window_controllers_) { | 171 for (auto& root_window_controller_ptr : root_window_controllers_) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 306 } |
| 303 | 307 |
| 304 void WindowManager::OnEmbedRootDestroyed( | 308 void WindowManager::OnEmbedRootDestroyed( |
| 305 aura::WindowTreeHostMus* window_tree_host) { | 309 aura::WindowTreeHostMus* window_tree_host) { |
| 306 // WindowManager should never see this. | 310 // WindowManager should never see this. |
| 307 NOTREACHED(); | 311 NOTREACHED(); |
| 308 } | 312 } |
| 309 | 313 |
| 310 void WindowManager::OnLostConnection(aura::WindowTreeClient* client) { | 314 void WindowManager::OnLostConnection(aura::WindowTreeClient* client) { |
| 311 DCHECK_EQ(client, window_tree_client_.get()); | 315 DCHECK_EQ(client, window_tree_client_.get()); |
| 316 if (!lost_connection_callback_.is_null()) { |
| 317 base::ResetAndReturn(&lost_connection_callback_).Run(); |
| 318 return; |
| 319 } |
| 312 Shutdown(); | 320 Shutdown(); |
| 313 // TODO(sky): this case should trigger shutting down WindowManagerApplication | 321 // TODO(sky): this case should trigger shutting down WindowManagerApplication |
| 314 // too. | 322 // too. |
| 315 } | 323 } |
| 316 | 324 |
| 317 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event, | 325 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event, |
| 318 aura::Window* target) { | 326 aura::Window* target) { |
| 319 pointer_watcher_event_router_->OnPointerEventObserved(event, target); | 327 pointer_watcher_event_router_->OnPointerEventObserved(event, target); |
| 320 } | 328 } |
| 321 | 329 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 bool WindowManager::IsWindowActive(aura::Window* window) { | 568 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 561 return Shell::Get()->activation_client()->GetActiveWindow() == window; | 569 return Shell::Get()->activation_client()->GetActiveWindow() == window; |
| 562 } | 570 } |
| 563 | 571 |
| 564 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 572 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 565 Shell::Get()->activation_client()->DeactivateWindow(window); | 573 Shell::Get()->activation_client()->DeactivateWindow(window); |
| 566 } | 574 } |
| 567 | 575 |
| 568 } // namespace mus | 576 } // namespace mus |
| 569 } // namespace ash | 577 } // namespace ash |
| OLD | NEW |