Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: mash/wm/root_window_controller.cc

Issue 1954933002: Initial cut of ash/wm/common classes for mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mash/wm/root_window_controller.h ('k') | mash/wm/window_layout.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_manager.h" 20 #include "mash/wm/shelf_layout_manager.h"
21 #include "mash/wm/status_layout_manager.h" 21 #include "mash/wm/status_layout_manager.h"
22 #include "mash/wm/window_layout.h" 22 #include "mash/wm/window_layout.h"
23 #include "mash/wm/window_manager.h" 23 #include "mash/wm/window_manager.h"
24 #include "mash/wm/window_manager_application.h" 24 #include "mash/wm/window_manager_application.h"
25 #include "services/shell/public/cpp/connector.h" 25 #include "services/shell/public/cpp/connector.h"
26 #include "ui/mojo/display/display_type_converters.h"
26 27
27 namespace mash { 28 namespace mash {
28 namespace wm { 29 namespace wm {
29 namespace { 30 namespace {
30 31
31 const uint32_t kWindowSwitchAccelerator = 1; 32 const uint32_t kWindowSwitchAccelerator = 1;
32 33
33 void AssertTrue(bool success) { 34 void AssertTrue(bool success) {
34 DCHECK(success); 35 DCHECK(success);
35 } 36 }
36 37
37 int ContainerToLocalId(mojom::Container container) { 38 int ContainerToLocalId(mojom::Container container) {
38 return static_cast<int>(container); 39 return static_cast<int>(container);
39 } 40 }
40 41
41 } // namespace 42 } // namespace
42 43
43 // static 44 // static
44 RootWindowController* RootWindowController::CreateFromDisplay( 45 RootWindowController* RootWindowController::CreateFromDisplay(
45 WindowManagerApplication* app, 46 WindowManagerApplication* app,
46 mus::mojom::DisplayPtr display, 47 mus::mojom::DisplayPtr display,
47 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { 48 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) {
48 RootWindowController* controller = new RootWindowController(app); 49 RootWindowController* controller = new RootWindowController(app);
49 controller->display_ = std::move(display); 50 controller->display_ = display.To<gfx::Display>();
50 mus::WindowTreeConnection::CreateForWindowManager( 51 mus::WindowTreeConnection::CreateForWindowManager(
51 controller, std::move(client_request), 52 controller, std::move(client_request),
52 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED, 53 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED,
53 controller->window_manager_.get()); 54 controller->window_manager_.get());
54 return controller; 55 return controller;
55 } 56 }
56 57
57 void RootWindowController::Destroy() { 58 void RootWindowController::Destroy() {
58 // See class description for details on lifetime. 59 // See class description for details on lifetime.
59 if (root_) { 60 if (root_) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 void RootWindowController::CreateContainers() { 197 void RootWindowController::CreateContainers() {
197 CreateContainer(mojom::Container::ALL_USER_BACKGROUND, 198 CreateContainer(mojom::Container::ALL_USER_BACKGROUND,
198 mojom::Container::ROOT); 199 mojom::Container::ROOT);
199 CreateContainer(mojom::Container::USER_WORKSPACE, mojom::Container::ROOT); 200 CreateContainer(mojom::Container::USER_WORKSPACE, mojom::Container::ROOT);
200 CreateContainer(mojom::Container::USER_BACKGROUND, 201 CreateContainer(mojom::Container::USER_BACKGROUND,
201 mojom::Container::USER_WORKSPACE); 202 mojom::Container::USER_WORKSPACE);
202 CreateContainer(mojom::Container::USER_PRIVATE, 203 CreateContainer(mojom::Container::USER_PRIVATE,
203 mojom::Container::USER_WORKSPACE); 204 mojom::Container::USER_WORKSPACE);
204 CreateContainer(mojom::Container::USER_WINDOWS, 205 CreateContainer(mojom::Container::USER_WINDOWS,
205 mojom::Container::USER_PRIVATE); 206 mojom::Container::USER_PRIVATE);
206 CreateContainer(mojom::Container::USER_STICKY_WINDOWS, 207 CreateContainer(mojom::Container::USER_ALWAYS_ON_TOP_WINDOWS,
207 mojom::Container::USER_PRIVATE); 208 mojom::Container::USER_PRIVATE);
208 CreateContainer(mojom::Container::USER_PRESENTATION_WINDOWS, 209 CreateContainer(mojom::Container::USER_PRESENTATION_WINDOWS,
209 mojom::Container::USER_PRIVATE); 210 mojom::Container::USER_PRIVATE);
210 CreateContainer(mojom::Container::USER_SHELF, mojom::Container::USER_PRIVATE); 211 CreateContainer(mojom::Container::USER_SHELF, mojom::Container::USER_PRIVATE);
211 CreateContainer(mojom::Container::LOGIN_WINDOWS, mojom::Container::ROOT); 212 CreateContainer(mojom::Container::LOGIN_WINDOWS, mojom::Container::ROOT);
212 CreateContainer(mojom::Container::LOGIN_APP, mojom::Container::LOGIN_WINDOWS); 213 CreateContainer(mojom::Container::LOGIN_APP, mojom::Container::LOGIN_WINDOWS);
213 CreateContainer(mojom::Container::LOGIN_SHELF, 214 CreateContainer(mojom::Container::LOGIN_SHELF,
214 mojom::Container::LOGIN_WINDOWS); 215 mojom::Container::LOGIN_WINDOWS);
215 CreateContainer(mojom::Container::STATUS, mojom::Container::ROOT); 216 CreateContainer(mojom::Container::STATUS, mojom::Container::ROOT);
216 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT); 217 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT);
217 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, 218 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS,
218 mojom::Container::ROOT); 219 mojom::Container::ROOT);
219 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); 220 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT);
220 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); 221 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT);
221 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); 222 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT);
222 } 223 }
223 224
224 } // namespace wm 225 } // namespace wm
225 } // namespace mash 226 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/root_window_controller.h ('k') | mash/wm/window_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698