| 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 |
| 11 #include "ash/common/drag_drop/drag_image_view.h" | 11 #include "ash/common/drag_drop/drag_image_view.h" |
| 12 #include "ash/common/session/session_controller.h" | 12 #include "ash/common/session/session_controller.h" |
| 13 #include "ash/common/wm/container_finder.h" | 13 #include "ash/common/wm/container_finder.h" |
| 14 #include "ash/common/wm/window_state.h" | 14 #include "ash/common/wm/window_state.h" |
| 15 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 16 #include "ash/mus/accelerators/accelerator_handler.h" | 16 #include "ash/mus/accelerators/accelerator_handler.h" |
| 17 #include "ash/mus/accelerators/accelerator_ids.h" | 17 #include "ash/mus/accelerators/accelerator_ids.h" |
| 18 #include "ash/mus/bridge/wm_shell_mus.h" | 18 #include "ash/mus/bridge/wm_shell_mus.h" |
| 19 #include "ash/mus/move_event_handler.h" | 19 #include "ash/mus/move_event_handler.h" |
| 20 #include "ash/mus/non_client_frame_controller.h" | 20 #include "ash/mus/non_client_frame_controller.h" |
| 21 #include "ash/mus/property_util.h" | 21 #include "ash/mus/property_util.h" |
| 22 #include "ash/mus/screen_mus.h" | 22 #include "ash/mus/screen_mus.h" |
| 23 #include "ash/mus/shell_delegate_mus.h" | 23 #include "ash/mus/shell_delegate_mus.h" |
| 24 #include "ash/mus/top_level_window_factory.h" | 24 #include "ash/mus/top_level_window_factory.h" |
| 25 #include "ash/mus/window_properties.h" | 25 #include "ash/mus/window_properties.h" |
| 26 #include "ash/public/cpp/config.h" | 26 #include "ash/public/cpp/config.h" |
| 27 #include "ash/public/cpp/shelf_types.h" | 27 #include "ash/public/cpp/shelf_types.h" |
| 28 #include "ash/public/cpp/shell_window_ids.h" | 28 #include "ash/public/cpp/shell_window_ids.h" |
| 29 #include "ash/public/cpp/window_pin_type.h" |
| 29 #include "ash/public/cpp/window_properties.h" | 30 #include "ash/public/cpp/window_properties.h" |
| 31 #include "ash/public/interfaces/window_pin_type.mojom.h" |
| 30 #include "ash/root_window_controller.h" | 32 #include "ash/root_window_controller.h" |
| 31 #include "ash/root_window_settings.h" | 33 #include "ash/root_window_settings.h" |
| 32 #include "ash/shell.h" | 34 #include "ash/shell.h" |
| 33 #include "ash/shell_init_params.h" | 35 #include "ash/shell_init_params.h" |
| 34 #include "ash/wm/ash_focus_rules.h" | 36 #include "ash/wm/ash_focus_rules.h" |
| 35 #include "base/memory/ptr_util.h" | 37 #include "base/memory/ptr_util.h" |
| 36 #include "base/threading/sequenced_worker_pool.h" | 38 #include "base/threading/sequenced_worker_pool.h" |
| 37 #include "services/service_manager/public/cpp/connector.h" | 39 #include "services/service_manager/public/cpp/connector.h" |
| 38 #include "services/ui/common/accelerator_util.h" | 40 #include "services/ui/common/accelerator_util.h" |
| 39 #include "services/ui/common/types.h" | 41 #include "services/ui/common/types.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 kRenderTitleAreaProperty, | 87 kRenderTitleAreaProperty, |
| 86 ui::mojom::WindowManager::kRenderParentTitleArea_Property, | 88 ui::mojom::WindowManager::kRenderParentTitleArea_Property, |
| 87 aura::PropertyConverter::CreateAcceptAnyValueCallback()); | 89 aura::PropertyConverter::CreateAcceptAnyValueCallback()); |
| 88 property_converter_->RegisterProperty( | 90 property_converter_->RegisterProperty( |
| 89 kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property, | 91 kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property, |
| 90 base::Bind(&IsValidShelfItemType)); | 92 base::Bind(&IsValidShelfItemType)); |
| 91 property_converter_->RegisterProperty( | 93 property_converter_->RegisterProperty( |
| 92 ::wm::kShadowElevationKey, | 94 ::wm::kShadowElevationKey, |
| 93 ui::mojom::WindowManager::kShadowElevation_Property, | 95 ui::mojom::WindowManager::kShadowElevation_Property, |
| 94 base::Bind(&::wm::IsValidShadowElevation)); | 96 base::Bind(&::wm::IsValidShadowElevation)); |
| 97 property_converter_->RegisterProperty(kWindowPinTypeKey, |
| 98 ash::mojom::kWindowPinType_Property, |
| 99 base::Bind(&ash::IsValidWindowPinType)); |
| 95 } | 100 } |
| 96 | 101 |
| 97 WindowManager::~WindowManager() { | 102 WindowManager::~WindowManager() { |
| 98 Shutdown(); | 103 Shutdown(); |
| 99 ash::Shell::set_window_tree_client(nullptr); | 104 ash::Shell::set_window_tree_client(nullptr); |
| 100 ash::Shell::set_window_manager_client(nullptr); | 105 ash::Shell::set_window_manager_client(nullptr); |
| 101 } | 106 } |
| 102 | 107 |
| 103 void WindowManager::Init( | 108 void WindowManager::Init( |
| 104 std::unique_ptr<aura::WindowTreeClient> window_tree_client, | 109 std::unique_ptr<aura::WindowTreeClient> window_tree_client, |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 bool WindowManager::IsWindowActive(aura::Window* window) { | 562 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 558 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; | 563 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; |
| 559 } | 564 } |
| 560 | 565 |
| 561 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 566 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 562 Shell::GetInstance()->activation_client()->DeactivateWindow(window); | 567 Shell::GetInstance()->activation_client()->DeactivateWindow(window); |
| 563 } | 568 } |
| 564 | 569 |
| 565 } // namespace mus | 570 } // namespace mus |
| 566 } // namespace ash | 571 } // namespace ash |
| OLD | NEW |