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