| 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" |
| 11 #include "components/mus/public/cpp/event_matcher_util.h" | 11 #include "components/mus/public/cpp/event_matcher_util.h" |
| 12 #include "components/mus/public/cpp/window.h" | 12 #include "components/mus/public/cpp/window.h" |
| 13 #include "components/mus/public/cpp/window_tree_connection.h" | 13 #include "components/mus/public/cpp/window_tree_connection.h" |
| 14 #include "components/mus/public/cpp/window_tree_host_factory.h" | 14 #include "components/mus/public/cpp/window_tree_host_factory.h" |
| 15 #include "mash/session/public/interfaces/session.mojom.h" | 15 #include "mash/session/public/interfaces/session.mojom.h" |
| 16 #include "mash/wm/background_layout.h" | 16 #include "mash/wm/background_layout.h" |
| 17 #include "mash/wm/fill_layout.h" | 17 #include "mash/wm/fill_layout.h" |
| 18 #include "mash/wm/screenlock_layout.h" | 18 #include "mash/wm/screenlock_layout.h" |
| 19 #include "mash/wm/shadow_controller.h" | 19 #include "mash/wm/shadow_controller.h" |
| 20 #include "mash/wm/shelf_layout.h" | 20 #include "mash/wm/shelf_layout.h" |
| 21 #include "mash/wm/window_layout.h" | 21 #include "mash/wm/window_layout.h" |
| 22 #include "mash/wm/window_manager.h" | 22 #include "mash/wm/window_manager.h" |
| 23 #include "mash/wm/window_manager_application.h" | 23 #include "mash/wm/window_manager_application.h" |
| 24 #include "services/shell/public/cpp/connector.h" | 24 #include "services/shell/public/cpp/connector.h" |
| 25 #include "ui/mojo/display/display_type_converters.h" |
| 25 | 26 |
| 26 namespace mash { | 27 namespace mash { |
| 27 namespace wm { | 28 namespace wm { |
| 28 namespace { | 29 namespace { |
| 29 | 30 |
| 30 const uint32_t kWindowSwitchAccelerator = 1; | 31 const uint32_t kWindowSwitchAccelerator = 1; |
| 31 | 32 |
| 32 void AssertTrue(bool success) { | 33 void AssertTrue(bool success) { |
| 33 DCHECK(success); | 34 DCHECK(success); |
| 34 } | 35 } |
| 35 | 36 |
| 36 int ContainerToLocalId(mojom::Container container) { | 37 int ContainerToLocalId(mojom::Container container) { |
| 37 return static_cast<int>(container); | 38 return static_cast<int>(container); |
| 38 } | 39 } |
| 39 | 40 |
| 40 } // namespace | 41 } // namespace |
| 41 | 42 |
| 42 // static | 43 // static |
| 43 RootWindowController* RootWindowController::CreateFromDisplay( | 44 RootWindowController* RootWindowController::CreateFromDisplay( |
| 44 WindowManagerApplication* app, | 45 WindowManagerApplication* app, |
| 45 mus::mojom::DisplayPtr display, | 46 mus::mojom::DisplayPtr display, |
| 46 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 47 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
| 47 RootWindowController* controller = new RootWindowController(app); | 48 RootWindowController* controller = new RootWindowController(app); |
| 48 controller->display_ = std::move(display); | 49 controller->display_ = display.To<gfx::Display>(); |
| 49 mus::WindowTreeConnection::CreateForWindowManager( | 50 mus::WindowTreeConnection::CreateForWindowManager( |
| 50 controller, std::move(client_request), | 51 controller, std::move(client_request), |
| 51 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED, | 52 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED, |
| 52 controller->window_manager_.get()); | 53 controller->window_manager_.get()); |
| 53 return controller; | 54 return controller; |
| 54 } | 55 } |
| 55 | 56 |
| 56 void RootWindowController::Destroy() { | 57 void RootWindowController::Destroy() { |
| 57 // See class description for details on lifetime. | 58 // See class description for details on lifetime. |
| 58 if (root_) { | 59 if (root_) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 void RootWindowController::CreateContainers() { | 189 void RootWindowController::CreateContainers() { |
| 189 CreateContainer(mojom::Container::ALL_USER_BACKGROUND, | 190 CreateContainer(mojom::Container::ALL_USER_BACKGROUND, |
| 190 mojom::Container::ROOT); | 191 mojom::Container::ROOT); |
| 191 CreateContainer(mojom::Container::USER_WORKSPACE, mojom::Container::ROOT); | 192 CreateContainer(mojom::Container::USER_WORKSPACE, mojom::Container::ROOT); |
| 192 CreateContainer(mojom::Container::USER_BACKGROUND, | 193 CreateContainer(mojom::Container::USER_BACKGROUND, |
| 193 mojom::Container::USER_WORKSPACE); | 194 mojom::Container::USER_WORKSPACE); |
| 194 CreateContainer(mojom::Container::USER_PRIVATE, | 195 CreateContainer(mojom::Container::USER_PRIVATE, |
| 195 mojom::Container::USER_WORKSPACE); | 196 mojom::Container::USER_WORKSPACE); |
| 196 CreateContainer(mojom::Container::USER_WINDOWS, | 197 CreateContainer(mojom::Container::USER_WINDOWS, |
| 197 mojom::Container::USER_PRIVATE); | 198 mojom::Container::USER_PRIVATE); |
| 198 CreateContainer(mojom::Container::USER_STICKY_WINDOWS, | 199 CreateContainer(mojom::Container::USER_ALWAYS_ON_TOP_WINDOWS, |
| 199 mojom::Container::USER_PRIVATE); | 200 mojom::Container::USER_PRIVATE); |
| 200 CreateContainer(mojom::Container::USER_PRESENTATION_WINDOWS, | 201 CreateContainer(mojom::Container::USER_PRESENTATION_WINDOWS, |
| 201 mojom::Container::USER_PRIVATE); | 202 mojom::Container::USER_PRIVATE); |
| 202 CreateContainer(mojom::Container::USER_SHELF, mojom::Container::USER_PRIVATE); | 203 CreateContainer(mojom::Container::USER_SHELF, mojom::Container::USER_PRIVATE); |
| 203 CreateContainer(mojom::Container::LOGIN_WINDOWS, mojom::Container::ROOT); | 204 CreateContainer(mojom::Container::LOGIN_WINDOWS, mojom::Container::ROOT); |
| 204 CreateContainer(mojom::Container::LOGIN_APP, mojom::Container::LOGIN_WINDOWS); | 205 CreateContainer(mojom::Container::LOGIN_APP, mojom::Container::LOGIN_WINDOWS); |
| 205 CreateContainer(mojom::Container::LOGIN_SHELF, | 206 CreateContainer(mojom::Container::LOGIN_SHELF, |
| 206 mojom::Container::LOGIN_WINDOWS); | 207 mojom::Container::LOGIN_WINDOWS); |
| 207 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT); | 208 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT); |
| 208 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, | 209 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, |
| 209 mojom::Container::ROOT); | 210 mojom::Container::ROOT); |
| 210 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); | 211 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); |
| 211 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); | 212 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); |
| 212 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); | 213 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); |
| 213 } | 214 } |
| 214 | 215 |
| 215 } // namespace wm | 216 } // namespace wm |
| 216 } // namespace mash | 217 } // namespace mash |
| OLD | NEW |