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