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

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

Issue 2233003003: services/ui: Inject GpuService instance where needed, instead of singleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « ui/views/mus/surface_context_factory.cc ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/window_manager_connection.h" 5 #include "ui/views/mus/window_manager_connection.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 WindowManagerConnection::WindowManagerConnection( 134 WindowManagerConnection::WindowManagerConnection(
135 shell::Connector* connector, 135 shell::Connector* connector,
136 const shell::Identity& identity) 136 const shell::Identity& identity)
137 : connector_(connector), 137 : connector_(connector),
138 identity_(identity), 138 identity_(identity),
139 pointer_watcher_want_moves_(false) { 139 pointer_watcher_want_moves_(false) {
140 lazy_tls_ptr.Pointer()->Set(this); 140 lazy_tls_ptr.Pointer()->Set(this);
141 141
142 gpu_service_ = ui::GpuService::Initialize(connector); 142 gpu_service_ = ui::GpuService::Initialize(connector);
143 compositor_context_factory_.reset(new views::SurfaceContextFactory()); 143 compositor_context_factory_.reset(
144 new views::SurfaceContextFactory(gpu_service_.get()));
144 aura::Env::GetInstance()->set_context_factory( 145 aura::Env::GetInstance()->set_context_factory(
145 compositor_context_factory_.get()); 146 compositor_context_factory_.get());
146 client_.reset(new ui::WindowTreeClient(this, nullptr, nullptr)); 147 client_.reset(new ui::WindowTreeClient(this, nullptr, nullptr));
147 client_->ConnectViaWindowTreeFactory(connector_); 148 client_->ConnectViaWindowTreeFactory(connector_);
148 149
149 screen_.reset(new ScreenMus(this)); 150 screen_.reset(new ScreenMus(this));
150 screen_->Init(connector); 151 screen_->Init(connector);
151 152
152 std::unique_ptr<ClipboardMus> clipboard(new ClipboardMus); 153 std::unique_ptr<ClipboardMus> clipboard(new ClipboardMus);
153 clipboard->Init(connector); 154 clipboard->Init(connector);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { 206 gfx::Point WindowManagerConnection::GetCursorScreenPoint() {
206 return client_->GetCursorScreenPoint(); 207 return client_->GetCursorScreenPoint();
207 } 208 }
208 209
209 std::unique_ptr<OSExchangeData::Provider> 210 std::unique_ptr<OSExchangeData::Provider>
210 WindowManagerConnection::BuildProvider() { 211 WindowManagerConnection::BuildProvider() {
211 return base::MakeUnique<OSExchangeDataProviderMus>(); 212 return base::MakeUnique<OSExchangeDataProviderMus>();
212 } 213 }
213 214
214 } // namespace views 215 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/surface_context_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698