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

Unified Diff: services/clipboard/main.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/authentication/main.cc ('k') | services/device_info/device_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/clipboard/main.cc
diff --git a/services/clipboard/main.cc b/services/clipboard/main.cc
index cdbb564a647c60d60d06dd821978458043747569..b6b3b5b93884399872a2cb805c26ab61b2685746 100644
--- a/services/clipboard/main.cc
+++ b/services/clipboard/main.cc
@@ -6,11 +6,9 @@
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/interface_factory.h"
#include "services/clipboard/clipboard_standalone_impl.h"
-class Delegate : public mojo::ApplicationDelegate,
- public mojo::InterfaceFactory<mojo::Clipboard> {
+class Delegate : public mojo::ApplicationDelegate {
public:
Delegate() {}
~Delegate() override {}
@@ -18,17 +16,15 @@ class Delegate : public mojo::ApplicationDelegate,
// mojo::ApplicationDelegate implementation.
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
- connection->AddService(this);
+ connection->GetServiceProviderImpl().AddService<mojo::Clipboard>(
+ [](const mojo::ConnectionContext& connection_context,
+ mojo::InterfaceRequest<mojo::Clipboard> clipboard_request) {
+ // TODO(erg): Write native implementations of the clipboard. For now,
+ // we just build a clipboard which doesn't interact with the system.
+ new clipboard::ClipboardStandaloneImpl(clipboard_request.Pass());
+ });
return true;
}
-
- // mojo::InterfaceFactory<mojo::Clipboard> implementation.
- void Create(const mojo::ConnectionContext& connection_context,
- mojo::InterfaceRequest<mojo::Clipboard> request) override {
- // TODO(erg): Write native implementations of the clipboard. For now, we
- // just build a clipboard which doesn't interact with the system.
- new clipboard::ClipboardStandaloneImpl(request.Pass());
- }
};
MojoResult MojoMain(MojoHandle application_request) {
« no previous file with comments | « services/authentication/main.cc ('k') | services/device_info/device_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698