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_impl.h" | 5 #include "mash/wm/window_manager_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "components/mus/common/types.h" | 10 #include "components/mus/common/types.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void WindowManagerImpl::OpenWindow( | 99 void WindowManagerImpl::OpenWindow( |
100 mus::mojom::WindowTreeClientPtr client, | 100 mus::mojom::WindowTreeClientPtr client, |
101 mojo::Map<mojo::String, mojo::Array<uint8_t>> transport_properties) { | 101 mojo::Map<mojo::String, mojo::Array<uint8_t>> transport_properties) { |
102 DCHECK(state_); | 102 DCHECK(state_); |
103 mus::Window* root = state_->root(); | 103 mus::Window* root = state_->root(); |
104 DCHECK(root); | 104 DCHECK(root); |
105 | 105 |
106 mus::Window::SharedProperties properties = | 106 mus::Window::SharedProperties properties = |
107 transport_properties.To<mus::Window::SharedProperties>(); | 107 transport_properties.To<mus::Window::SharedProperties>(); |
108 const bool provide_non_client_frame = | 108 const bool provide_non_client_frame = |
109 GetWindowType(properties) == mus::mojom::WINDOW_TYPE_WINDOW; | 109 GetWindowType(properties) == mus::mojom::WindowType::WINDOW; |
110 if (provide_non_client_frame) | 110 if (provide_non_client_frame) |
111 properties[mus::mojom::kWaitForUnderlay_Property].clear(); | 111 properties[mus::mojom::kWaitForUnderlay_Property].clear(); |
112 | 112 |
113 // TODO(sky): constrain and validate properties before passing to server. | 113 // TODO(sky): constrain and validate properties before passing to server. |
114 mus::Window* child_window = root->connection()->NewWindow(&properties); | 114 mus::Window* child_window = root->connection()->NewWindow(&properties); |
115 child_window->SetBounds(CalculateDefaultBounds(child_window)); | 115 child_window->SetBounds(CalculateDefaultBounds(child_window)); |
116 | 116 |
117 mojom::Container container = GetRequestedContainer(child_window); | 117 mojom::Container container = GetRequestedContainer(child_window); |
118 state_->GetWindowForContainer(container)->AddChild(child_window); | 118 state_->GetWindowForContainer(container)->AddChild(child_window); |
119 child_window->Embed(std::move(client)); | 119 child_window->Embed(std::move(client)); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // TODO(sky): constrain this to set of keys we know about, and allowed | 169 // TODO(sky): constrain this to set of keys we know about, and allowed |
170 // values. | 170 // values. |
171 return name == mus::mojom::WindowManager::kShowState_Property || | 171 return name == mus::mojom::WindowManager::kShowState_Property || |
172 name == mus::mojom::WindowManager::kPreferredSize_Property || | 172 name == mus::mojom::WindowManager::kPreferredSize_Property || |
173 name == mus::mojom::WindowManager::kResizeBehavior_Property || | 173 name == mus::mojom::WindowManager::kResizeBehavior_Property || |
174 name == mus::mojom::WindowManager::kWindowTitle_Property; | 174 name == mus::mojom::WindowManager::kWindowTitle_Property; |
175 } | 175 } |
176 | 176 |
177 } // namespace wm | 177 } // namespace wm |
178 } // namespace mash | 178 } // namespace mash |
OLD | NEW |