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

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

Issue 1782123003: Makes WindowTree take the AccessPolicy (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/connection_manager.h ('k') | components/mus/ws/default_access_policy.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/connection_manager.h" 5 #include "components/mus/ws/connection_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "components/mus/ws/connection_manager_delegate.h" 9 #include "components/mus/ws/connection_manager_delegate.h"
10 #include "components/mus/ws/display.h" 10 #include "components/mus/ws/display.h"
11 #include "components/mus/ws/display_binding.h" 11 #include "components/mus/ws/display_binding.h"
12 #include "components/mus/ws/display_manager.h" 12 #include "components/mus/ws/display_manager.h"
13 #include "components/mus/ws/operation.h" 13 #include "components/mus/ws/operation.h"
14 #include "components/mus/ws/server_window.h" 14 #include "components/mus/ws/server_window.h"
15 #include "components/mus/ws/window_coordinate_conversions.h" 15 #include "components/mus/ws/window_coordinate_conversions.h"
16 #include "components/mus/ws/window_manager_access_policy.h"
16 #include "components/mus/ws/window_manager_factory_service.h" 17 #include "components/mus/ws/window_manager_factory_service.h"
17 #include "components/mus/ws/window_manager_state.h" 18 #include "components/mus/ws/window_manager_state.h"
18 #include "components/mus/ws/window_tree.h" 19 #include "components/mus/ws/window_tree.h"
19 #include "components/mus/ws/window_tree_binding.h" 20 #include "components/mus/ws/window_tree_binding.h"
20 #include "mojo/converters/geometry/geometry_type_converters.h" 21 #include "mojo/converters/geometry/geometry_type_converters.h"
21 #include "mojo/converters/input_events/input_events_type_converters.h" 22 #include "mojo/converters/input_events/input_events_type_converters.h"
22 #include "mojo/converters/surfaces/surfaces_type_converters.h" 23 #include "mojo/converters/surfaces/surfaces_type_converters.h"
23 #include "mojo/shell/public/cpp/connection.h" 24 #include "mojo/shell/public/cpp/connection.h"
24 #include "ui/gfx/geometry/size_conversions.h" 25 #include "ui/gfx/geometry/size_conversions.h"
25 26
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 63
63 ConnectionSpecificId ConnectionManager::GetAndAdvanceNextConnectionId() { 64 ConnectionSpecificId ConnectionManager::GetAndAdvanceNextConnectionId() {
64 const ConnectionSpecificId id = next_connection_id_++; 65 const ConnectionSpecificId id = next_connection_id_++;
65 DCHECK_LT(id, next_connection_id_); 66 DCHECK_LT(id, next_connection_id_);
66 return id; 67 return id;
67 } 68 }
68 69
69 WindowTree* ConnectionManager::EmbedAtWindow( 70 WindowTree* ConnectionManager::EmbedAtWindow(
70 ServerWindow* root, 71 ServerWindow* root,
71 const UserId& user_id, 72 const UserId& user_id,
72 mojom::WindowTreeClientPtr client) { 73 mojom::WindowTreeClientPtr client,
73 scoped_ptr<WindowTree> tree_ptr(new WindowTree(this, user_id, root)); 74 scoped_ptr<AccessPolicy> access_policy) {
75 scoped_ptr<WindowTree> tree_ptr(
76 new WindowTree(this, user_id, root, std::move(access_policy)));
74 WindowTree* tree = tree_ptr.get(); 77 WindowTree* tree = tree_ptr.get();
75 78
76 mojom::WindowTreePtr window_tree_ptr; 79 mojom::WindowTreePtr window_tree_ptr;
77 scoped_ptr<WindowTreeBinding> binding = 80 scoped_ptr<WindowTreeBinding> binding =
78 delegate_->CreateWindowTreeBindingForEmbedAtWindow( 81 delegate_->CreateWindowTreeBindingForEmbedAtWindow(
79 this, tree, GetProxy(&window_tree_ptr), std::move(client)); 82 this, tree, GetProxy(&window_tree_ptr), std::move(client));
80 83
81 AddTree(std::move(tree_ptr), std::move(binding), std::move(window_tree_ptr)); 84 AddTree(std::move(tree_ptr), std::move(binding), std::move(window_tree_ptr));
82 OnTreeMessagedClient(tree->id()); 85 OnTreeMessagedClient(tree->id());
83 return tree; 86 return tree;
(...skipping 10 matching lines...) Expand all
94 } 97 }
95 98
96 WindowTree* ConnectionManager::CreateTreeForWindowManager( 99 WindowTree* ConnectionManager::CreateTreeForWindowManager(
97 Display* display, 100 Display* display,
98 mojom::WindowManagerFactory* factory, 101 mojom::WindowManagerFactory* factory,
99 ServerWindow* root, 102 ServerWindow* root,
100 const UserId& user_id) { 103 const UserId& user_id) {
101 mojom::DisplayPtr display_ptr = display->ToMojomDisplay(); 104 mojom::DisplayPtr display_ptr = display->ToMojomDisplay();
102 mojom::WindowTreeClientPtr tree_client; 105 mojom::WindowTreeClientPtr tree_client;
103 factory->CreateWindowManager(std::move(display_ptr), GetProxy(&tree_client)); 106 factory->CreateWindowManager(std::move(display_ptr), GetProxy(&tree_client));
104 scoped_ptr<WindowTree> tree_ptr(new WindowTree(this, user_id, root)); 107 scoped_ptr<WindowTree> tree_ptr(new WindowTree(
108 this, user_id, root, make_scoped_ptr(new WindowManagerAccessPolicy)));
105 WindowTree* tree = tree_ptr.get(); 109 WindowTree* tree = tree_ptr.get();
106 scoped_ptr<DefaultWindowTreeBinding> binding(new DefaultWindowTreeBinding( 110 scoped_ptr<DefaultWindowTreeBinding> binding(new DefaultWindowTreeBinding(
107 tree_ptr.get(), this, std::move(tree_client))); 111 tree_ptr.get(), this, std::move(tree_client)));
108 mojom::WindowTreePtr window_tree_ptr = binding->CreateInterfacePtrAndBind(); 112 mojom::WindowTreePtr window_tree_ptr = binding->CreateInterfacePtrAndBind();
109 AddTree(std::move(tree_ptr), std::move(binding), std::move(window_tree_ptr)); 113 AddTree(std::move(tree_ptr), std::move(binding), std::move(window_tree_ptr));
110 tree->ConfigureWindowManager(); 114 tree->ConfigureWindowManager();
111 return tree; 115 return tree;
112 } 116 }
113 117
114 void ConnectionManager::DestroyTree(WindowTree* tree) { 118 void ConnectionManager::DestroyTree(WindowTree* tree) {
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 void ConnectionManager::OnFirstDisplayReady() { 593 void ConnectionManager::OnFirstDisplayReady() {
590 delegate_->OnFirstDisplayReady(); 594 delegate_->OnFirstDisplayReady();
591 } 595 }
592 596
593 void ConnectionManager::OnNoMoreDisplays() { 597 void ConnectionManager::OnNoMoreDisplays() {
594 delegate_->OnNoMoreDisplays(); 598 delegate_->OnNoMoreDisplays();
595 } 599 }
596 600
597 } // namespace ws 601 } // namespace ws
598 } // namespace mus 602 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/default_access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698