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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 mus::Window* WindowManagerImpl::NewTopLevelWindow( | 87 mus::Window* WindowManagerImpl::NewTopLevelWindow( |
88 std::map<std::string, std::vector<uint8_t>>* properties, | 88 std::map<std::string, std::vector<uint8_t>>* properties, |
89 mus::mojom::WindowTreeClientPtr client) { | 89 mus::mojom::WindowTreeClientPtr client) { |
90 DCHECK(state_); | 90 DCHECK(state_); |
91 mus::Window* root = state_->root(); | 91 mus::Window* root = state_->root(); |
92 DCHECK(root); | 92 DCHECK(root); |
93 | 93 |
94 const bool provide_non_client_frame = | 94 const bool provide_non_client_frame = |
95 GetWindowType(*properties) == mus::mojom::WINDOW_TYPE_WINDOW; | 95 GetWindowType(*properties) == mus::mojom::WindowType::WINDOW; |
96 if (provide_non_client_frame) | 96 if (provide_non_client_frame) |
97 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); | 97 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); |
98 | 98 |
99 // TODO(sky): constrain and validate properties before passing to server. | 99 // TODO(sky): constrain and validate properties before passing to server. |
100 mus::Window* window = root->connection()->NewWindow(properties); | 100 mus::Window* window = root->connection()->NewWindow(properties); |
101 window->SetBounds(CalculateDefaultBounds(window)); | 101 window->SetBounds(CalculateDefaultBounds(window)); |
102 | 102 |
103 mojom::Container container = GetRequestedContainer(window); | 103 mojom::Container container = GetRequestedContainer(window); |
104 state_->GetWindowForContainer(container)->AddChild(window); | 104 state_->GetWindowForContainer(container)->AddChild(window); |
105 | 105 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 name == mus::mojom::WindowManager::kWindowTitle_Property; | 184 name == mus::mojom::WindowManager::kWindowTitle_Property; |
185 } | 185 } |
186 | 186 |
187 mus::Window* WindowManagerImpl::OnWmCreateTopLevelWindow( | 187 mus::Window* WindowManagerImpl::OnWmCreateTopLevelWindow( |
188 std::map<std::string, std::vector<uint8_t>>* properties) { | 188 std::map<std::string, std::vector<uint8_t>>* properties) { |
189 return NewTopLevelWindow(properties, nullptr); | 189 return NewTopLevelWindow(properties, nullptr); |
190 } | 190 } |
191 | 191 |
192 } // namespace wm | 192 } // namespace wm |
193 } // namespace mash | 193 } // namespace mash |
OLD | NEW |