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

Side by Side Diff: ui/views/mus/mus_client.cc

Issue 2536943005: Adds couple of functions to WindowManagerDelegate: (Closed)
Patch Set: comment Created 4 years 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 | « ui/views/mus/mus_client.h ('k') | no next file » | 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 "ui/views/mus/mus_client.h" 5 #include "ui/views/mus/mus_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "services/service_manager/public/cpp/connection.h" 9 #include "services/service_manager/public/cpp/connection.h"
10 #include "services/service_manager/public/cpp/connector.h" 10 #include "services/service_manager/public/cpp/connector.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 observer_list_.AddObserver(observer); 165 observer_list_.AddObserver(observer);
166 } 166 }
167 167
168 void MusClient::RemoveObserver(MusClientObserver* observer) { 168 void MusClient::RemoveObserver(MusClientObserver* observer) {
169 observer_list_.RemoveObserver(observer); 169 observer_list_.RemoveObserver(observer);
170 } 170 }
171 171
172 MusClient::MusClient(service_manager::Connector* connector, 172 MusClient::MusClient(service_manager::Connector* connector,
173 const service_manager::Identity& identity, 173 const service_manager::Identity& identity,
174 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) 174 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
175 : connector_(connector), identity_(identity) { 175 : identity_(identity) {
176 DCHECK(!instance_); 176 DCHECK(!instance_);
177 instance_ = this; 177 instance_ = this;
178 // TODO(msw): Avoid this... use some default value? Allow clients to extend? 178 // TODO(msw): Avoid this... use some default value? Allow clients to extend?
179 property_converter_ = base::MakeUnique<aura::PropertyConverter>(); 179 property_converter_ = base::MakeUnique<aura::PropertyConverter>();
180 180
181 wm_state_ = base::MakeUnique<wm::WMState>(); 181 wm_state_ = base::MakeUnique<wm::WMState>();
182 182
183 gpu_service_ = ui::GpuService::Create(connector, std::move(io_task_runner)); 183 gpu_service_ = ui::GpuService::Create(connector, std::move(io_task_runner));
184 compositor_context_factory_ = 184 compositor_context_factory_ =
185 base::MakeUnique<aura::MusContextFactory>(gpu_service_.get()); 185 base::MakeUnique<aura::MusContextFactory>(gpu_service_.get());
186 aura::Env::GetInstance()->set_context_factory( 186 aura::Env::GetInstance()->set_context_factory(
187 compositor_context_factory_.get()); 187 compositor_context_factory_.get());
188 window_tree_client_ = 188 window_tree_client_ =
189 base::MakeUnique<aura::WindowTreeClient>(this, nullptr, nullptr); 189 base::MakeUnique<aura::WindowTreeClient>(connector, this);
190 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get()); 190 aura::Env::GetInstance()->SetWindowTreeClient(window_tree_client_.get());
191 window_tree_client_->ConnectViaWindowTreeFactory(connector_); 191 window_tree_client_->ConnectViaWindowTreeFactory();
192 192
193 pointer_watcher_event_router_ = 193 pointer_watcher_event_router_ =
194 base::MakeUnique<PointerWatcherEventRouter2>(window_tree_client_.get()); 194 base::MakeUnique<PointerWatcherEventRouter2>(window_tree_client_.get());
195 195
196 screen_ = base::MakeUnique<ScreenMus>(this); 196 screen_ = base::MakeUnique<ScreenMus>(this);
197 screen_->Init(connector); 197 screen_->Init(connector);
198 198
199 std::unique_ptr<ClipboardMus> clipboard = base::MakeUnique<ClipboardMus>(); 199 std::unique_ptr<ClipboardMus> clipboard = base::MakeUnique<ClipboardMus>();
200 clipboard->Init(connector); 200 clipboard->Init(connector);
201 ui::Clipboard::SetClipboardForCurrentThread(std::move(clipboard)); 201 ui::Clipboard::SetClipboardForCurrentThread(std::move(clipboard));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 return root->GetTopWindowContainingPoint(relative_point); 253 return root->GetTopWindowContainingPoint(relative_point);
254 } 254 }
255 return nullptr; 255 return nullptr;
256 } 256 }
257 257
258 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { 258 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() {
259 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); 259 return base::MakeUnique<aura::OSExchangeDataProviderMus>();
260 } 260 }
261 261
262 } // namespace views 262 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/mus_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698