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

Side by Side Diff: services/ui/ws/window_manager_window_tree_factory.cc

Issue 2904993003: chromeos: changes how DisplayManagerObservers are notified (Closed)
Patch Set: cleanup Created 3 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 | « services/ui/ws/window_manager_state.cc ('k') | services/ui/ws/window_server.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 "services/ui/ws/window_manager_window_tree_factory.h" 5 #include "services/ui/ws/window_manager_window_tree_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "services/ui/ws/display_creation_config.h"
8 #include "services/ui/ws/window_manager_window_tree_factory_set.h" 9 #include "services/ui/ws/window_manager_window_tree_factory_set.h"
9 #include "services/ui/ws/window_server.h" 10 #include "services/ui/ws/window_server.h"
10 #include "services/ui/ws/window_server_delegate.h" 11 #include "services/ui/ws/window_server_delegate.h"
11 #include "services/ui/ws/window_tree.h" 12 #include "services/ui/ws/window_tree.h"
12 13
13 namespace ui { 14 namespace ui {
14 namespace ws { 15 namespace ws {
15 16
16 WindowManagerWindowTreeFactory::WindowManagerWindowTreeFactory( 17 WindowManagerWindowTreeFactory::WindowManagerWindowTreeFactory(
17 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set, 18 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set,
(...skipping 14 matching lines...) Expand all
32 if (window_tree_) { 33 if (window_tree_) {
33 DVLOG(1) << "CreateWindowTree() called more than once."; 34 DVLOG(1) << "CreateWindowTree() called more than once.";
34 return; 35 return;
35 } 36 }
36 37
37 // CreateWindowTree() can only be called once, so there is no reason to keep 38 // CreateWindowTree() can only be called once, so there is no reason to keep
38 // the binding around. 39 // the binding around.
39 if (binding_.is_bound()) 40 if (binding_.is_bound())
40 binding_.Close(); 41 binding_.Close();
41 42
42 window_manager_window_tree_factory_set_->window_server() 43 // If the config is MANUAL, then all WindowManagers must connect as MANUAL.
43 ->delegate() 44 if (!automatically_create_display_roots &&
44 ->OnWillCreateTreeForWindowManager(automatically_create_display_roots); 45 GetWindowServer()->display_creation_config() ==
46 DisplayCreationConfig::AUTOMATIC) {
47 DVLOG(1) << "CreateWindowTree() called with manual and automatic.";
48 return;
49 }
45 50
46 SetWindowTree(GetWindowServer()->CreateTreeForWindowManager( 51 SetWindowTree(GetWindowServer()->CreateTreeForWindowManager(
47 user_id_, std::move(window_tree_request), std::move(window_tree_client), 52 user_id_, std::move(window_tree_request), std::move(window_tree_client),
48 automatically_create_display_roots)); 53 automatically_create_display_roots));
49 } 54 }
50 55
51 WindowManagerWindowTreeFactory::WindowManagerWindowTreeFactory( 56 WindowManagerWindowTreeFactory::WindowManagerWindowTreeFactory(
52 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set, 57 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set,
53 const UserId& user_id) 58 const UserId& user_id)
54 : window_manager_window_tree_factory_set_( 59 : window_manager_window_tree_factory_set_(
55 window_manager_window_tree_factory_set), 60 window_manager_window_tree_factory_set),
56 user_id_(user_id), 61 user_id_(user_id),
57 binding_(this) {} 62 binding_(this) {}
58 63
59 WindowServer* WindowManagerWindowTreeFactory::GetWindowServer() { 64 WindowServer* WindowManagerWindowTreeFactory::GetWindowServer() {
60 return window_manager_window_tree_factory_set_->window_server(); 65 return window_manager_window_tree_factory_set_->window_server();
61 } 66 }
62 67
63 void WindowManagerWindowTreeFactory::SetWindowTree(WindowTree* window_tree) { 68 void WindowManagerWindowTreeFactory::SetWindowTree(WindowTree* window_tree) {
64 DCHECK(!window_tree_); 69 DCHECK(!window_tree_);
65 window_tree_ = window_tree; 70 window_tree_ = window_tree;
66 71
67 window_manager_window_tree_factory_set_ 72 window_manager_window_tree_factory_set_
68 ->OnWindowManagerWindowTreeFactoryReady(this); 73 ->OnWindowManagerWindowTreeFactoryReady(this);
69 } 74 }
70 75
71 } // namespace ws 76 } // namespace ws
72 } // namespace ui 77 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_manager_state.cc ('k') | services/ui/ws/window_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698