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

Unified Diff: services/ui/service.cc

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/service.h ('k') | services/ui/test_wm/test_wm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/service.cc
diff --git a/services/ui/service.cc b/services/ui/service.cc
index 9b4991dccf24dc8da486b75fe3262e2e7667b548..60db35581ea01357f7e79b03aa2019a28b302c1f 100644
--- a/services/ui/service.cc
+++ b/services/ui/service.cc
@@ -195,39 +195,41 @@ void Service::OnStart() {
discardable_shared_memory_manager_ =
base::MakeUnique<discardable_memory::DiscardableSharedMemoryManager>();
-}
-bool Service::OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) {
- registry->AddInterface<mojom::AccessibilityManager>(this);
- registry->AddInterface<mojom::Clipboard>(this);
- registry->AddInterface<mojom::DisplayManager>(this);
- registry->AddInterface<mojom::Gpu>(this);
- registry->AddInterface<mojom::IMERegistrar>(this);
- registry->AddInterface<mojom::IMEServer>(this);
- registry->AddInterface<mojom::UserAccessManager>(this);
- registry->AddInterface<mojom::UserActivityMonitor>(this);
- registry->AddInterface<WindowTreeHostFactory>(this);
- registry->AddInterface<mojom::WindowManagerWindowTreeFactory>(this);
- registry->AddInterface<mojom::WindowTreeFactory>(this);
- registry
- ->AddInterface<discardable_memory::mojom::DiscardableSharedMemoryManager>(
+ registry_.AddInterface<mojom::AccessibilityManager>(this);
+ registry_.AddInterface<mojom::Clipboard>(this);
+ registry_.AddInterface<mojom::DisplayManager>(this);
+ registry_.AddInterface<mojom::Gpu>(this);
+ registry_.AddInterface<mojom::IMERegistrar>(this);
+ registry_.AddInterface<mojom::IMEServer>(this);
+ registry_.AddInterface<mojom::UserAccessManager>(this);
+ registry_.AddInterface<mojom::UserActivityMonitor>(this);
+ registry_.AddInterface<WindowTreeHostFactory>(this);
+ registry_.AddInterface<mojom::WindowManagerWindowTreeFactory>(this);
+ registry_.AddInterface<mojom::WindowTreeFactory>(this);
+ registry_
+ .AddInterface<discardable_memory::mojom::DiscardableSharedMemoryManager>(
this);
if (test_config_)
- registry->AddInterface<WindowServerTest>(this);
+ registry_.AddInterface<WindowServerTest>(this);
// On non-Linux platforms there will be no DeviceDataManager instance and no
// purpose in adding the Mojo interface to connect to.
if (input_device_server_.IsRegisteredAsObserver())
- input_device_server_.AddInterface(registry);
+ input_device_server_.AddInterface(&registry_);
- screen_manager_->AddInterfaces(registry);
+ screen_manager_->AddInterfaces(&registry_);
#if defined(USE_OZONE)
- ui::OzonePlatform::GetInstance()->AddInterfaces(registry);
+ ui::OzonePlatform::GetInstance()->AddInterfaces(&registry_);
#endif
+}
- return true;
+void Service::OnBindInterface(const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) {
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
void Service::StartDisplayInit() {
« no previous file with comments | « services/ui/service.h ('k') | services/ui/test_wm/test_wm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698