| 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 23 matching lines...) Expand all Loading... |
| 34 #include "ash/wm/window_properties.h" | 34 #include "ash/wm/window_properties.h" |
| 35 #include "base/memory/ptr_util.h" | 35 #include "base/memory/ptr_util.h" |
| 36 #include "services/service_manager/public/cpp/connector.h" | 36 #include "services/service_manager/public/cpp/connector.h" |
| 37 #include "services/ui/common/accelerator_util.h" | 37 #include "services/ui/common/accelerator_util.h" |
| 38 #include "services/ui/common/types.h" | 38 #include "services/ui/common/types.h" |
| 39 #include "services/ui/public/cpp/property_type_converters.h" | 39 #include "services/ui/public/cpp/property_type_converters.h" |
| 40 #include "services/ui/public/interfaces/constants.mojom.h" | 40 #include "services/ui/public/interfaces/constants.mojom.h" |
| 41 #include "services/ui/public/interfaces/window_manager.mojom.h" | 41 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 42 #include "ui/aura/client/window_parenting_client.h" | 42 #include "ui/aura/client/window_parenting_client.h" |
| 43 #include "ui/aura/env.h" | 43 #include "ui/aura/env.h" |
| 44 #include "ui/aura/mus/capture_synchronizer.h" |
| 44 #include "ui/aura/mus/property_converter.h" | 45 #include "ui/aura/mus/property_converter.h" |
| 45 #include "ui/aura/mus/window_tree_client.h" | 46 #include "ui/aura/mus/window_tree_client.h" |
| 46 #include "ui/aura/mus/window_tree_host_mus.h" | 47 #include "ui/aura/mus/window_tree_host_mus.h" |
| 47 #include "ui/aura/window.h" | 48 #include "ui/aura/window.h" |
| 48 #include "ui/base/class_property.h" | 49 #include "ui/base/class_property.h" |
| 49 #include "ui/base/hit_test.h" | 50 #include "ui/base/hit_test.h" |
| 50 #include "ui/display/display_observer.h" | 51 #include "ui/display/display_observer.h" |
| 51 #include "ui/events/mojo/event.mojom.h" | 52 #include "ui/events/mojo/event.mojom.h" |
| 52 #include "ui/views/mus/pointer_watcher_event_router.h" | 53 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 53 #include "ui/views/mus/screen_mus.h" | 54 #include "ui/views/mus/screen_mus.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 const gfx::Insets client_area_insets = | 108 const gfx::Insets client_area_insets = |
| 108 NonClientFrameController::GetPreferredClientAreaInsets(); | 109 NonClientFrameController::GetPreferredClientAreaInsets(); |
| 109 frame_decoration_values->normal_client_area_insets = client_area_insets; | 110 frame_decoration_values->normal_client_area_insets = client_area_insets; |
| 110 frame_decoration_values->maximized_client_area_insets = client_area_insets; | 111 frame_decoration_values->maximized_client_area_insets = client_area_insets; |
| 111 frame_decoration_values->max_title_bar_button_width = | 112 frame_decoration_values->max_title_bar_button_width = |
| 112 NonClientFrameController::GetMaxTitleBarButtonWidth(); | 113 NonClientFrameController::GetMaxTitleBarButtonWidth(); |
| 113 window_manager_client_->SetFrameDecorationValues( | 114 window_manager_client_->SetFrameDecorationValues( |
| 114 std::move(frame_decoration_values)); | 115 std::move(frame_decoration_values)); |
| 115 | 116 |
| 116 lookup_.reset(new WmLookupMus); | 117 lookup_.reset(new WmLookupMus); |
| 118 |
| 119 // Notify PointerWatcherEventRouter and CaptureSynchronizer that the capture |
| 120 // client has been set. |
| 121 aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); |
| 122 pointer_watcher_event_router_->AttachToCaptureClient(capture_client); |
| 123 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( |
| 124 capture_client); |
| 117 } | 125 } |
| 118 | 126 |
| 119 void WindowManager::DeleteAllRootWindowControllers() { | 127 void WindowManager::DeleteAllRootWindowControllers() { |
| 120 // Primary RootWindowController must be destroyed last. | 128 // Primary RootWindowController must be destroyed last. |
| 121 RootWindowController* primary_root_window_controller = | 129 RootWindowController* primary_root_window_controller = |
| 122 GetPrimaryRootWindowController(); | 130 GetPrimaryRootWindowController(); |
| 123 std::set<RootWindowController*> secondary_root_window_controllers; | 131 std::set<RootWindowController*> secondary_root_window_controllers; |
| 124 for (auto& root_window_controller_ptr : root_window_controllers_) { | 132 for (auto& root_window_controller_ptr : root_window_controllers_) { |
| 125 if (root_window_controller_ptr.get() != primary_root_window_controller) { | 133 if (root_window_controller_ptr.get() != primary_root_window_controller) { |
| 126 secondary_root_window_controllers.insert( | 134 secondary_root_window_controllers.insert( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 root_window_controllers_.erase(iter); | 239 root_window_controllers_.erase(iter); |
| 232 break; | 240 break; |
| 233 } | 241 } |
| 234 } | 242 } |
| 235 } | 243 } |
| 236 | 244 |
| 237 void WindowManager::Shutdown() { | 245 void WindowManager::Shutdown() { |
| 238 if (!window_tree_client_) | 246 if (!window_tree_client_) |
| 239 return; | 247 return; |
| 240 | 248 |
| 249 aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); |
| 250 pointer_watcher_event_router_->DetachFromCaptureClient(capture_client); |
| 251 window_tree_client_->capture_synchronizer()->DetachFromCaptureClient( |
| 252 capture_client); |
| 253 |
| 241 Shell::DeleteInstance(); | 254 Shell::DeleteInstance(); |
| 242 | 255 |
| 243 lookup_.reset(); | 256 lookup_.reset(); |
| 244 shadow_controller_.reset(); | 257 shadow_controller_.reset(); |
| 245 | 258 |
| 246 pointer_watcher_event_router_.reset(); | 259 pointer_watcher_event_router_.reset(); |
| 247 | 260 |
| 248 window_tree_client_.reset(); | 261 window_tree_client_.reset(); |
| 249 window_manager_client_ = nullptr; | 262 window_manager_client_ = nullptr; |
| 250 } | 263 } |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 bool WindowManager::IsWindowActive(aura::Window* window) { | 468 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 456 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; | 469 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; |
| 457 } | 470 } |
| 458 | 471 |
| 459 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 472 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 460 Shell::GetInstance()->activation_client()->DeactivateWindow(window); | 473 Shell::GetInstance()->activation_client()->DeactivateWindow(window); |
| 461 } | 474 } |
| 462 | 475 |
| 463 } // namespace mus | 476 } // namespace mus |
| 464 } // namespace ash | 477 } // namespace ash |
| OLD | NEW |