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

Unified Diff: mojo/examples/surfaces_app/child_app.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 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 | « mojo/examples/png_viewer/png_viewer.cc ('k') | mojo/examples/surfaces_app/child_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/surfaces_app/child_app.cc
diff --git a/mojo/examples/surfaces_app/child_app.cc b/mojo/examples/surfaces_app/child_app.cc
index 0a5c03424fb7d7937992fcca19df8cb0a41567e0..215f496caec51e7d54ec69106e69e5013c278de3 100644
--- a/mojo/examples/surfaces_app/child_app.cc
+++ b/mojo/examples/surfaces_app/child_app.cc
@@ -11,28 +11,31 @@
namespace mojo {
namespace examples {
-class ChildApp : public ApplicationDelegate, public ChildImpl::Context {
+class ChildApp : public ApplicationDelegate, public InterfaceFactory<Child> {
public:
ChildApp() {}
virtual ~ChildApp() {}
- virtual void Initialize(ApplicationImpl* app) OVERRIDE { app_ = app; }
+ virtual void Initialize(ApplicationImpl* app) OVERRIDE {
+ surfaces_service_connection_ =
+ app->ConnectToApplication("mojo:mojo_surfaces_service");
+ }
// ApplicationDelegate implementation.
virtual bool ConfigureIncomingConnection(
ApplicationConnection* connection) OVERRIDE {
- connection->AddService<ChildImpl, ChildImpl::Context>(this);
+ connection->AddService(this);
return true;
}
- // ChildImpl::Context implementation.
- virtual ApplicationConnection* ShellConnection(
- const mojo::String& application_url) OVERRIDE {
- return app_->ConnectToApplication(application_url);
+ // InterfaceFactory<Child> implementation.
+ virtual void Create(ApplicationConnection* connection,
+ InterfaceRequest<Child> request) OVERRIDE {
+ BindToRequest(new ChildImpl(surfaces_service_connection_), &request);
}
private:
- ApplicationImpl* app_;
+ ApplicationConnection* surfaces_service_connection_;
DISALLOW_COPY_AND_ASSIGN(ChildApp);
};
« no previous file with comments | « mojo/examples/png_viewer/png_viewer.cc ('k') | mojo/examples/surfaces_app/child_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698