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

Side by Side Diff: services/ui/service.cc

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: rebased Created 3 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 | « services/ui/service.h ('k') | services/ui/ws/BUILD.gn » ('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 "services/ui/service.h" 5 #include "services/ui/service.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 22 matching lines...) Expand all
33 #include "services/ui/ws/display_manager.h" 33 #include "services/ui/ws/display_manager.h"
34 #include "services/ui/ws/gpu_host.h" 34 #include "services/ui/ws/gpu_host.h"
35 #include "services/ui/ws/user_activity_monitor.h" 35 #include "services/ui/ws/user_activity_monitor.h"
36 #include "services/ui/ws/user_display_manager.h" 36 #include "services/ui/ws/user_display_manager.h"
37 #include "services/ui/ws/window_server.h" 37 #include "services/ui/ws/window_server.h"
38 #include "services/ui/ws/window_server_test_impl.h" 38 #include "services/ui/ws/window_server_test_impl.h"
39 #include "services/ui/ws/window_tree.h" 39 #include "services/ui/ws/window_tree.h"
40 #include "services/ui/ws/window_tree_binding.h" 40 #include "services/ui/ws/window_tree_binding.h"
41 #include "services/ui/ws/window_tree_factory.h" 41 #include "services/ui/ws/window_tree_factory.h"
42 #include "services/ui/ws/window_tree_host_factory.h" 42 #include "services/ui/ws/window_tree_host_factory.h"
43 #include "services/ui/ws/window_tree_host_factory_registrar.h"
43 #include "ui/base/platform_window_defaults.h" 44 #include "ui/base/platform_window_defaults.h"
44 #include "ui/base/resource/resource_bundle.h" 45 #include "ui/base/resource/resource_bundle.h"
45 #include "ui/base/ui_base_paths.h" 46 #include "ui/base/ui_base_paths.h"
46 #include "ui/events/event_switches.h" 47 #include "ui/events/event_switches.h"
47 #include "ui/events/platform/platform_event_source.h" 48 #include "ui/events/platform/platform_event_source.h"
48 #include "ui/gfx/geometry/rect.h" 49 #include "ui/gfx/geometry/rect.h"
49 #include "ui/gl/gl_surface.h" 50 #include "ui/gl/gl_surface.h"
50 51
51 #if defined(USE_X11) 52 #if defined(USE_X11)
52 #include <X11/Xlib.h> 53 #include <X11/Xlib.h>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, 201 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info,
201 service_manager::InterfaceRegistry* registry) { 202 service_manager::InterfaceRegistry* registry) {
202 registry->AddInterface<mojom::AccessibilityManager>(this); 203 registry->AddInterface<mojom::AccessibilityManager>(this);
203 registry->AddInterface<mojom::Clipboard>(this); 204 registry->AddInterface<mojom::Clipboard>(this);
204 registry->AddInterface<mojom::DisplayManager>(this); 205 registry->AddInterface<mojom::DisplayManager>(this);
205 registry->AddInterface<mojom::Gpu>(this); 206 registry->AddInterface<mojom::Gpu>(this);
206 registry->AddInterface<mojom::IMERegistrar>(this); 207 registry->AddInterface<mojom::IMERegistrar>(this);
207 registry->AddInterface<mojom::IMEServer>(this); 208 registry->AddInterface<mojom::IMEServer>(this);
208 registry->AddInterface<mojom::UserAccessManager>(this); 209 registry->AddInterface<mojom::UserAccessManager>(this);
209 registry->AddInterface<mojom::UserActivityMonitor>(this); 210 registry->AddInterface<mojom::UserActivityMonitor>(this);
210 registry->AddInterface<WindowTreeHostFactory>(this); 211 registry->AddInterface<mojom::WindowTreeHostFactory>(this);
212 registry->AddInterface<mojom::WindowTreeHostFactoryRegistrar>(this);
211 registry->AddInterface<mojom::WindowManagerWindowTreeFactory>(this); 213 registry->AddInterface<mojom::WindowManagerWindowTreeFactory>(this);
212 registry->AddInterface<mojom::WindowTreeFactory>(this); 214 registry->AddInterface<mojom::WindowTreeFactory>(this);
213 registry 215 registry
214 ->AddInterface<discardable_memory::mojom::DiscardableSharedMemoryManager>( 216 ->AddInterface<discardable_memory::mojom::DiscardableSharedMemoryManager>(
215 this); 217 this);
216 if (test_config_) 218 if (test_config_)
217 registry->AddInterface<WindowServerTest>(this); 219 registry->AddInterface<WindowServerTest>(this);
218 220
219 // On non-Linux platforms there will be no DeviceDataManager instance and no 221 // On non-Linux platforms there will be no DeviceDataManager instance and no
220 // purpose in adding the Mojo interface to connect to. 222 // purpose in adding the Mojo interface to connect to.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 void Service::Create(const service_manager::Identity& remote_identity, 350 void Service::Create(const service_manager::Identity& remote_identity,
349 mojom::WindowTreeHostFactoryRequest request) { 351 mojom::WindowTreeHostFactoryRequest request) {
350 UserState* user_state = GetUserState(remote_identity); 352 UserState* user_state = GetUserState(remote_identity);
351 if (!user_state->window_tree_host_factory) { 353 if (!user_state->window_tree_host_factory) {
352 user_state->window_tree_host_factory.reset(new ws::WindowTreeHostFactory( 354 user_state->window_tree_host_factory.reset(new ws::WindowTreeHostFactory(
353 window_server_.get(), remote_identity.user_id())); 355 window_server_.get(), remote_identity.user_id()));
354 } 356 }
355 user_state->window_tree_host_factory->AddBinding(std::move(request)); 357 user_state->window_tree_host_factory->AddBinding(std::move(request));
356 } 358 }
357 359
360 void Service::Create(const service_manager::Identity& remote_identity,
361 mojom::WindowTreeHostFactoryRegistrarRequest request) {
362 AddUserIfNecessary(remote_identity);
363 mojo::MakeStrongBinding(base::MakeUnique<ws::WindowTreeHostFactoryRegistrar>(
364 window_server_.get(), remote_identity.user_id()),
365 std::move(request));
366 window_server_->SetInExternalWindowMode();
367 }
368
358 void Service::Create( 369 void Service::Create(
359 const service_manager::Identity& remote_identity, 370 const service_manager::Identity& remote_identity,
360 discardable_memory::mojom::DiscardableSharedMemoryManagerRequest request) { 371 discardable_memory::mojom::DiscardableSharedMemoryManagerRequest request) {
361 discardable_shared_memory_manager_->Bind(std::move(request)); 372 discardable_shared_memory_manager_->Bind(std::move(request));
362 } 373 }
363 374
364 void Service::Create(const service_manager::Identity& remote_identity, 375 void Service::Create(const service_manager::Identity& remote_identity,
365 mojom::WindowServerTestRequest request) { 376 mojom::WindowServerTestRequest request) {
366 if (!test_config_) 377 if (!test_config_)
367 return; 378 return;
368 mojo::MakeStrongBinding( 379 mojo::MakeStrongBinding(
369 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), 380 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()),
370 std::move(request)); 381 std::move(request));
371 } 382 }
372 383
373 384
374 } // namespace ui 385 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/service.h ('k') | services/ui/ws/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698