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); |
}; |