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 "mash/wm/window_manager.h" | 5 #include "mash/wm/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/wm/common/container_finder.h" | 11 #include "ash/wm/common/container_finder.h" |
12 #include "components/mus/common/types.h" | 12 #include "components/mus/common/types.h" |
13 #include "components/mus/public/cpp/property_type_converters.h" | 13 #include "components/mus/public/cpp/property_type_converters.h" |
14 #include "components/mus/public/cpp/window.h" | 14 #include "components/mus/public/cpp/window.h" |
15 #include "components/mus/public/cpp/window_property.h" | 15 #include "components/mus/public/cpp/window_property.h" |
16 #include "components/mus/public/cpp/window_tree_connection.h" | 16 #include "components/mus/public/cpp/window_tree_client.h" |
17 #include "components/mus/public/interfaces/input_events.mojom.h" | 17 #include "components/mus/public/interfaces/input_events.mojom.h" |
18 #include "components/mus/public/interfaces/mus_constants.mojom.h" | 18 #include "components/mus/public/interfaces/mus_constants.mojom.h" |
19 #include "components/mus/public/interfaces/window_manager.mojom.h" | 19 #include "components/mus/public/interfaces/window_manager.mojom.h" |
20 #include "mash/wm/bridge/wm_window_mus.h" | 20 #include "mash/wm/bridge/wm_window_mus.h" |
21 #include "mash/wm/non_client_frame_controller.h" | 21 #include "mash/wm/non_client_frame_controller.h" |
22 #include "mash/wm/property_util.h" | 22 #include "mash/wm/property_util.h" |
23 #include "mash/wm/public/interfaces/container.mojom.h" | 23 #include "mash/wm/public/interfaces/container.mojom.h" |
24 #include "mash/wm/root_window_controller.h" | 24 #include "mash/wm/root_window_controller.h" |
25 | 25 |
26 namespace mash { | 26 namespace mash { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 DCHECK(root); | 82 DCHECK(root); |
83 | 83 |
84 // TODO(sky): panels need a different frame, http:://crbug.com/614362. | 84 // TODO(sky): panels need a different frame, http:://crbug.com/614362. |
85 const bool provide_non_client_frame = | 85 const bool provide_non_client_frame = |
86 GetWindowType(*properties) == mus::mojom::WindowType::WINDOW || | 86 GetWindowType(*properties) == mus::mojom::WindowType::WINDOW || |
87 GetWindowType(*properties) == mus::mojom::WindowType::PANEL; | 87 GetWindowType(*properties) == mus::mojom::WindowType::PANEL; |
88 if (provide_non_client_frame) | 88 if (provide_non_client_frame) |
89 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); | 89 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); |
90 | 90 |
91 // TODO(sky): constrain and validate properties before passing to server. | 91 // TODO(sky): constrain and validate properties before passing to server. |
92 mus::Window* window = root->connection()->NewWindow(properties); | 92 mus::Window* window = root->window_tree()->NewWindow(properties); |
93 window->SetBounds(CalculateDefaultBounds(window)); | 93 window->SetBounds(CalculateDefaultBounds(window)); |
94 | 94 |
95 mus::Window* container_window = nullptr; | 95 mus::Window* container_window = nullptr; |
96 if (window->HasSharedProperty(mojom::kWindowContainer_Property)) { | 96 if (window->HasSharedProperty(mojom::kWindowContainer_Property)) { |
97 container_window = | 97 container_window = |
98 root_controller_->GetWindowForContainer(GetRequestedContainer(window)); | 98 root_controller_->GetWindowForContainer(GetRequestedContainer(window)); |
99 } else { | 99 } else { |
100 // TODO(sky): window->bounds() isn't quite right. | 100 // TODO(sky): window->bounds() isn't quite right. |
101 container_window = WmWindowMus::GetMusWindow( | 101 container_window = WmWindowMus::GetMusWindow( |
102 ash::wm::GetDefaultParent(WmWindowMus::Get(root_controller_->root()), | 102 ash::wm::GetDefaultParent(WmWindowMus::Get(root_controller_->root()), |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 void WindowManager::ScreenlockStateChanged(bool locked) { | 204 void WindowManager::ScreenlockStateChanged(bool locked) { |
205 // Hide USER_PRIVATE_CONTAINER windows when the screen is locked. | 205 // Hide USER_PRIVATE_CONTAINER windows when the screen is locked. |
206 mus::Window* window = root_controller_->GetWindowForContainer( | 206 mus::Window* window = root_controller_->GetWindowForContainer( |
207 mash::wm::mojom::Container::USER_PRIVATE); | 207 mash::wm::mojom::Container::USER_PRIVATE); |
208 window->SetVisible(!locked); | 208 window->SetVisible(!locked); |
209 } | 209 } |
210 | 210 |
211 } // namespace wm | 211 } // namespace wm |
212 } // namespace mash | 212 } // namespace mash |
OLD | NEW |