| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 const gfx::Insets client_area_insets = | 107 const gfx::Insets client_area_insets = |
| 108 NonClientFrameController::GetPreferredClientAreaInsets(); | 108 NonClientFrameController::GetPreferredClientAreaInsets(); |
| 109 frame_decoration_values->normal_client_area_insets = client_area_insets; | 109 frame_decoration_values->normal_client_area_insets = client_area_insets; |
| 110 frame_decoration_values->maximized_client_area_insets = client_area_insets; | 110 frame_decoration_values->maximized_client_area_insets = client_area_insets; |
| 111 frame_decoration_values->max_title_bar_button_width = | 111 frame_decoration_values->max_title_bar_button_width = |
| 112 NonClientFrameController::GetMaxTitleBarButtonWidth(); | 112 NonClientFrameController::GetMaxTitleBarButtonWidth(); |
| 113 window_manager_client_->SetFrameDecorationValues( | 113 window_manager_client_->SetFrameDecorationValues( |
| 114 std::move(frame_decoration_values)); | 114 std::move(frame_decoration_values)); |
| 115 | 115 |
| 116 lookup_.reset(new WmLookupMus); | 116 lookup_.reset(new WmLookupMus); |
| 117 |
| 118 // Notify PointerWatcherEventRouter and CaptureSynchronizer that the capture |
| 119 // client has been set. |
| 120 aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); |
| 121 capture_client->AddObserver(pointer_watcher_event_router_.get()); |
| 122 window_tree_client_->OnCaptureClientSet(capture_client); |
| 117 } | 123 } |
| 118 | 124 |
| 119 void WindowManager::DeleteAllRootWindowControllers() { | 125 void WindowManager::DeleteAllRootWindowControllers() { |
| 120 // Primary RootWindowController must be destroyed last. | 126 // Primary RootWindowController must be destroyed last. |
| 121 RootWindowController* primary_root_window_controller = | 127 RootWindowController* primary_root_window_controller = |
| 122 GetPrimaryRootWindowController(); | 128 GetPrimaryRootWindowController(); |
| 123 std::set<RootWindowController*> secondary_root_window_controllers; | 129 std::set<RootWindowController*> secondary_root_window_controllers; |
| 124 for (auto& root_window_controller_ptr : root_window_controllers_) { | 130 for (auto& root_window_controller_ptr : root_window_controllers_) { |
| 125 if (root_window_controller_ptr.get() != primary_root_window_controller) { | 131 if (root_window_controller_ptr.get() != primary_root_window_controller) { |
| 126 secondary_root_window_controllers.insert( | 132 secondary_root_window_controllers.insert( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 root_window_controllers_.erase(iter); | 237 root_window_controllers_.erase(iter); |
| 232 break; | 238 break; |
| 233 } | 239 } |
| 234 } | 240 } |
| 235 } | 241 } |
| 236 | 242 |
| 237 void WindowManager::Shutdown() { | 243 void WindowManager::Shutdown() { |
| 238 if (!window_tree_client_) | 244 if (!window_tree_client_) |
| 239 return; | 245 return; |
| 240 | 246 |
| 247 aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); |
| 248 capture_client->RemoveObserver(pointer_watcher_event_router_.get()); |
| 249 window_tree_client_->OnCaptureClientUnset(capture_client); |
| 250 |
| 241 Shell::DeleteInstance(); | 251 Shell::DeleteInstance(); |
| 242 | 252 |
| 243 lookup_.reset(); | 253 lookup_.reset(); |
| 244 shadow_controller_.reset(); | 254 shadow_controller_.reset(); |
| 245 | 255 |
| 246 pointer_watcher_event_router_.reset(); | 256 pointer_watcher_event_router_.reset(); |
| 247 | 257 |
| 248 window_tree_client_.reset(); | 258 window_tree_client_.reset(); |
| 249 window_manager_client_ = nullptr; | 259 window_manager_client_ = nullptr; |
| 250 } | 260 } |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 bool WindowManager::IsWindowActive(aura::Window* window) { | 465 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 456 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; | 466 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; |
| 457 } | 467 } |
| 458 | 468 |
| 459 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 469 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 460 Shell::GetInstance()->activation_client()->DeactivateWindow(window); | 470 Shell::GetInstance()->activation_client()->DeactivateWindow(window); |
| 461 } | 471 } |
| 462 | 472 |
| 463 } // namespace mus | 473 } // namespace mus |
| 464 } // namespace ash | 474 } // namespace ash |
| OLD | NEW |