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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 // TODO: need to register OSExchangeDataProviderMus. http://crbug.com/665077. | 76 // TODO: need to register OSExchangeDataProviderMus. http://crbug.com/665077. |
77 WindowManager::WindowManager(service_manager::Connector* connector, | 77 WindowManager::WindowManager(service_manager::Connector* connector, |
78 Config config, | 78 Config config, |
79 bool show_primary_host_on_connect) | 79 bool show_primary_host_on_connect) |
80 : connector_(connector), | 80 : connector_(connector), |
81 config_(config), | 81 config_(config), |
82 show_primary_host_on_connect_(show_primary_host_on_connect), | 82 show_primary_host_on_connect_(show_primary_host_on_connect), |
83 wm_state_(base::MakeUnique<::wm::WMState>()), | 83 wm_state_(base::MakeUnique<::wm::WMState>()), |
84 property_converter_(base::MakeUnique<aura::PropertyConverter>()) { | 84 property_converter_(base::MakeUnique<aura::PropertyConverter>()) { |
85 property_converter_->RegisterProperty( | 85 property_converter_->RegisterPrimitiveProperty( |
86 kPanelAttachedKey, ui::mojom::WindowManager::kPanelAttached_Property, | 86 kPanelAttachedKey, ui::mojom::WindowManager::kPanelAttached_Property, |
87 aura::PropertyConverter::CreateAcceptAnyValueCallback()); | 87 aura::PropertyConverter::CreateAcceptAnyValueCallback()); |
88 property_converter_->RegisterProperty( | 88 property_converter_->RegisterPrimitiveProperty( |
89 kRenderTitleAreaProperty, | 89 kRenderTitleAreaProperty, |
90 ui::mojom::WindowManager::kRenderParentTitleArea_Property, | 90 ui::mojom::WindowManager::kRenderParentTitleArea_Property, |
91 aura::PropertyConverter::CreateAcceptAnyValueCallback()); | 91 aura::PropertyConverter::CreateAcceptAnyValueCallback()); |
92 property_converter_->RegisterProperty( | 92 property_converter_->RegisterPrimitiveProperty( |
93 kShelfIDKey, ui::mojom::WindowManager::kShelfID_Property); | |
94 property_converter_->RegisterProperty( | |
95 kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property, | 93 kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property, |
96 base::Bind(&IsValidShelfItemType)); | 94 base::Bind(&IsValidShelfItemType)); |
97 property_converter_->RegisterProperty( | 95 property_converter_->RegisterPrimitiveProperty( |
98 ::wm::kShadowElevationKey, | 96 ::wm::kShadowElevationKey, |
99 ui::mojom::WindowManager::kShadowElevation_Property, | 97 ui::mojom::WindowManager::kShadowElevation_Property, |
100 base::Bind(&::wm::IsValidShadowElevation)); | 98 base::Bind(&::wm::IsValidShadowElevation)); |
101 property_converter_->RegisterProperty(kWindowPinTypeKey, | 99 property_converter_->RegisterPrimitiveProperty( |
102 ash::mojom::kWindowPinType_Property, | 100 kWindowPinTypeKey, ash::mojom::kWindowPinType_Property, |
103 base::Bind(&ash::IsValidWindowPinType)); | 101 base::Bind(&ash::IsValidWindowPinType)); |
| 102 property_converter_->RegisterStringProperty( |
| 103 kShelfIDKey, ui::mojom::WindowManager::kShelfID_Property); |
104 } | 104 } |
105 | 105 |
106 WindowManager::~WindowManager() { | 106 WindowManager::~WindowManager() { |
107 Shutdown(); | 107 Shutdown(); |
108 ash::Shell::set_window_tree_client(nullptr); | 108 ash::Shell::set_window_tree_client(nullptr); |
109 ash::Shell::set_window_manager_client(nullptr); | 109 ash::Shell::set_window_manager_client(nullptr); |
110 } | 110 } |
111 | 111 |
112 void WindowManager::Init( | 112 void WindowManager::Init( |
113 std::unique_ptr<aura::WindowTreeClient> window_tree_client, | 113 std::unique_ptr<aura::WindowTreeClient> window_tree_client, |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 bool WindowManager::IsWindowActive(aura::Window* window) { | 581 bool WindowManager::IsWindowActive(aura::Window* window) { |
582 return Shell::Get()->activation_client()->GetActiveWindow() == window; | 582 return Shell::Get()->activation_client()->GetActiveWindow() == window; |
583 } | 583 } |
584 | 584 |
585 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 585 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
586 Shell::Get()->activation_client()->DeactivateWindow(window); | 586 Shell::Get()->activation_client()->DeactivateWindow(window); |
587 } | 587 } |
588 | 588 |
589 } // namespace mus | 589 } // namespace mus |
590 } // namespace ash | 590 } // namespace ash |
OLD | NEW |