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

Unified Diff: services/device_info/device_info.cc

Issue 1981513002: ApplicationConnection devolution, part 2.2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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/clipboard/main.cc ('k') | services/files/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/device_info/device_info.cc
diff --git a/services/device_info/device_info.cc b/services/device_info/device_info.cc
index 59cfe33882ce3374ddab7ca4e67e2c95a8b2bf36..84e66cd236f1e5fd18344c974edf2fb947443bab 100644
--- a/services/device_info/device_info.cc
+++ b/services/device_info/device_info.cc
@@ -10,7 +10,6 @@
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_runner.h"
-#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/services/device_info/interfaces/device_info.mojom.h"
namespace mojo {
@@ -19,9 +18,7 @@ namespace device_info {
// This is a native Mojo application which implements |DeviceInfo| interface for
// Linux.
-class DeviceInfo : public ApplicationDelegate,
- public mojo::DeviceInfo,
- public InterfaceFactory<mojo::DeviceInfo> {
+class DeviceInfo : public ApplicationDelegate, public mojo::DeviceInfo {
public:
// We look for the 'DISPLAY' environment variable. If present, then we assume
// it to be a desktop, else we assume it to be a commandline
@@ -33,16 +30,14 @@ class DeviceInfo : public ApplicationDelegate,
// |ApplicationDelegate| override.
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
- connection->AddService<mojo::DeviceInfo>(this);
+ connection->GetServiceProviderImpl().AddService<mojo::DeviceInfo>(
+ [this](const ConnectionContext& connection_context,
+ InterfaceRequest<mojo::DeviceInfo> device_info_request) {
+ binding_.AddBinding(this, device_info_request.Pass());
+ });
return true;
}
- // |InterfaceFactory<DeviceInfo>| implementation.
- void Create(const ConnectionContext& connection_context,
- InterfaceRequest<mojo::DeviceInfo> request) override {
- binding_.AddBinding(this, request.Pass());
- }
-
private:
mojo::BindingSet<mojo::DeviceInfo> binding_;
};
« no previous file with comments | « services/clipboard/main.cc ('k') | services/files/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698