| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "components/mus/common/types.h" | 10 #include "components/mus/common/types.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); | 106 (*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); |
| 107 | 107 |
| 108 // TODO(sky): constrain and validate properties before passing to server. | 108 // TODO(sky): constrain and validate properties before passing to server. |
| 109 mus::Window* window = root->connection()->NewWindow(properties); | 109 mus::Window* window = root->connection()->NewWindow(properties); |
| 110 window->SetBounds(CalculateDefaultBounds(window)); | 110 window->SetBounds(CalculateDefaultBounds(window)); |
| 111 | 111 |
| 112 mojom::Container container = GetRequestedContainer(window); | 112 mojom::Container container = GetRequestedContainer(window); |
| 113 root_controller_->GetWindowForContainer(container)->AddChild(window); | 113 root_controller_->GetWindowForContainer(container)->AddChild(window); |
| 114 | 114 |
| 115 if (provide_non_client_frame) { | 115 if (provide_non_client_frame) { |
| 116 // NonClientFrameController deletes itself when |window| is destroyed. | 116 NonClientFrameController::Create(root_controller_->GetConnector(), window, |
| 117 new NonClientFrameController(root_controller_->GetConnector(), window, | 117 root_controller_->window_manager_client()); |
| 118 root_controller_->window_manager_client()); | |
| 119 } | 118 } |
| 120 | 119 |
| 121 root_controller_->IncrementWindowCount(); | 120 root_controller_->IncrementWindowCount(); |
| 122 | 121 |
| 123 return window; | 122 return window; |
| 124 } | 123 } |
| 125 | 124 |
| 126 void WindowManager::OnTreeChanging(const TreeChangeParams& params) { | 125 void WindowManager::OnTreeChanging(const TreeChangeParams& params) { |
| 127 DCHECK(root_controller_); | 126 DCHECK(root_controller_); |
| 128 if (root_controller_->WindowIsContainer(params.old_parent)) | 127 if (root_controller_->WindowIsContainer(params.old_parent)) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 167 |
| 169 void WindowManager::ScreenlockStateChanged(bool locked) { | 168 void WindowManager::ScreenlockStateChanged(bool locked) { |
| 170 // Hide USER_PRIVATE windows when the screen is locked. | 169 // Hide USER_PRIVATE windows when the screen is locked. |
| 171 mus::Window* window = root_controller_->GetWindowForContainer( | 170 mus::Window* window = root_controller_->GetWindowForContainer( |
| 172 mash::wm::mojom::Container::USER_PRIVATE); | 171 mash::wm::mojom::Container::USER_PRIVATE); |
| 173 window->SetVisible(!locked); | 172 window->SetVisible(!locked); |
| 174 } | 173 } |
| 175 | 174 |
| 176 } // namespace wm | 175 } // namespace wm |
| 177 } // namespace mash | 176 } // namespace mash |
| OLD | NEW |