| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/root_window_controller.h" | 5 #include "mash/wm/root_window_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "components/mus/common/util.h" | 10 #include "components/mus/common/util.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 const uint32_t kWindowSwitchAccelerator = 1; | 30 const uint32_t kWindowSwitchAccelerator = 1; |
| 31 | 31 |
| 32 void AssertTrue(bool success) { | 32 void AssertTrue(bool success) { |
| 33 DCHECK(success); | 33 DCHECK(success); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 // static | 38 // static |
| 39 RootWindowController* RootWindowController::CreateUsingWindowTreeHost( | |
| 40 WindowManagerApplication* app) { | |
| 41 RootWindowController* controller = new RootWindowController(app); | |
| 42 mus::CreateWindowTreeHost(app->connector(), controller, | |
| 43 &controller->window_tree_host_, | |
| 44 controller->window_manager_.get()); | |
| 45 return controller; | |
| 46 } | |
| 47 | |
| 48 // static | |
| 49 RootWindowController* RootWindowController::CreateFromDisplay( | 39 RootWindowController* RootWindowController::CreateFromDisplay( |
| 50 WindowManagerApplication* app, | 40 WindowManagerApplication* app, |
| 51 mus::mojom::DisplayPtr display, | 41 mus::mojom::DisplayPtr display, |
| 52 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 42 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
| 53 RootWindowController* controller = new RootWindowController(app); | 43 RootWindowController* controller = new RootWindowController(app); |
| 54 controller->display_ = std::move(display); | 44 controller->display_ = std::move(display); |
| 55 mus::WindowTreeConnection::CreateForWindowManager( | 45 mus::WindowTreeConnection::CreateForWindowManager( |
| 56 controller, std::move(client_request), | 46 controller, std::move(client_request), |
| 57 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED, | 47 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED, |
| 58 controller->window_manager_.get()); | 48 controller->window_manager_.get()); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 GetWindowForContainer(mojom::Container::USER_BACKGROUND); | 123 GetWindowForContainer(mojom::Container::USER_BACKGROUND); |
| 134 layout_manager_[user_background].reset(new BackgroundLayout(user_background)); | 124 layout_manager_[user_background].reset(new BackgroundLayout(user_background)); |
| 135 mus::Window* login_app = GetWindowForContainer(mojom::Container::LOGIN_APP); | 125 mus::Window* login_app = GetWindowForContainer(mojom::Container::LOGIN_APP); |
| 136 layout_manager_[login_app].reset(new ScreenlockLayout(login_app)); | 126 layout_manager_[login_app].reset(new ScreenlockLayout(login_app)); |
| 137 mus::Window* user_shelf = GetWindowForContainer(mojom::Container::USER_SHELF); | 127 mus::Window* user_shelf = GetWindowForContainer(mojom::Container::USER_SHELF); |
| 138 layout_manager_[user_shelf].reset(new ShelfLayout(user_shelf)); | 128 layout_manager_[user_shelf].reset(new ShelfLayout(user_shelf)); |
| 139 | 129 |
| 140 mus::Window* window = GetWindowForContainer(mojom::Container::USER_WINDOWS); | 130 mus::Window* window = GetWindowForContainer(mojom::Container::USER_WINDOWS); |
| 141 layout_manager_[window].reset(new WindowLayout(window)); | 131 layout_manager_[window].reset(new WindowLayout(window)); |
| 142 window_manager_client()->AddActivationParent(window); | 132 window_manager_client()->AddActivationParent(window); |
| 143 window_tree_host_->SetTitle("Mash"); | |
| 144 | 133 |
| 145 AddAccelerators(); | 134 AddAccelerators(); |
| 146 | 135 |
| 147 window_manager_->Initialize(this, app_->mash_shell()); | 136 window_manager_->Initialize(this, app_->mash_shell()); |
| 148 | 137 |
| 149 shadow_controller_.reset(new ShadowController(root->connection())); | 138 shadow_controller_.reset(new ShadowController(root->connection())); |
| 150 | 139 |
| 151 app_->OnRootWindowControllerDoneInit(this); | 140 app_->OnRootWindowControllerDoneInit(this); |
| 152 } | 141 } |
| 153 | 142 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 mojom::Container::LOGIN_WINDOWS); | 196 mojom::Container::LOGIN_WINDOWS); |
| 208 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, | 197 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, |
| 209 mojom::Container::ROOT); | 198 mojom::Container::ROOT); |
| 210 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); | 199 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); |
| 211 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); | 200 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); |
| 212 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); | 201 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); |
| 213 } | 202 } |
| 214 | 203 |
| 215 } // namespace wm | 204 } // namespace wm |
| 216 } // namespace mash | 205 } // namespace mash |
| OLD | NEW |