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

Side by Side Diff: components/mus/ws/window_manager_state.cc

Issue 1766943002: Refators display related functionality into own class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 9 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 | « components/mus/ws/test_utils.cc ('k') | components/mus/ws/window_tree.h » ('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 "components/mus/ws/window_manager_state.h" 5 #include "components/mus/ws/window_manager_state.h"
6 6
7 #include "components/mus/ws/connection_manager.h" 7 #include "components/mus/ws/connection_manager.h"
8 #include "components/mus/ws/display_manager.h"
8 #include "components/mus/ws/server_window.h" 9 #include "components/mus/ws/server_window.h"
9 #include "mojo/shell/public/interfaces/connector.mojom.h" 10 #include "mojo/shell/public/interfaces/connector.mojom.h"
10 11
11 namespace mus { 12 namespace mus {
12 namespace ws { 13 namespace ws {
13 14
14 WindowManagerState::WindowManagerState(Display* display) 15 WindowManagerState::WindowManagerState(Display* display)
15 : WindowManagerState(display, false, mojo::shell::mojom::kRootUserID) {} 16 : WindowManagerState(display, false, mojo::shell::mojom::kRootUserID) {}
16 17
17 WindowManagerState::WindowManagerState(Display* display, const UserId& user_id) 18 WindowManagerState::WindowManagerState(Display* display, const UserId& user_id)
18 : WindowManagerState(display, true, user_id) {} 19 : WindowManagerState(display, true, user_id) {}
19 20
20 WindowManagerState::~WindowManagerState() {} 21 WindowManagerState::~WindowManagerState() {}
21 22
22 WindowManagerState::WindowManagerState(Display* display, 23 WindowManagerState::WindowManagerState(Display* display,
23 bool is_user_id_valid, 24 bool is_user_id_valid,
24 const UserId& user_id) 25 const UserId& user_id)
25 : display_(display), 26 : display_(display),
26 is_user_id_valid_(is_user_id_valid), 27 is_user_id_valid_(is_user_id_valid),
27 user_id_(user_id) { 28 user_id_(user_id) {
28 ConnectionManager* connection_manager = display_->connection_manager(); 29 ConnectionManager* connection_manager = display_->connection_manager();
29 root_.reset(connection_manager->CreateServerWindow( 30 root_.reset(connection_manager->CreateServerWindow(
30 RootWindowId(connection_manager->GetAndAdvanceNextRootId()), 31 connection_manager->display_manager()->GetAndAdvanceNextRootId(),
31 ServerWindow::Properties())); 32 ServerWindow::Properties()));
32 // Our root is always a child of the Display's root. Do this 33 // Our root is always a child of the Display's root. Do this
33 // before the WindowTree has been created so that the client doesn't get 34 // before the WindowTree has been created so that the client doesn't get
34 // notified of the add, bounds change and visibility change. 35 // notified of the add, bounds change and visibility change.
35 root_->SetBounds(gfx::Rect(display->root_window()->bounds().size())); 36 root_->SetBounds(gfx::Rect(display->root_window()->bounds().size()));
36 root_->SetVisible(true); 37 root_->SetVisible(true);
37 display->root_window()->Add(root_.get()); 38 display->root_window()->Add(root_.get());
38 } 39 }
39 40
40 } // namespace ws 41 } // namespace ws
41 } // namespace mus 42 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/test_utils.cc ('k') | components/mus/ws/window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698