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..02db9690e269fd0cbf263e2408f802c1692e68f1 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 InterfaceProvider<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->AddServiceProvider(this); |
return true; |
} |
- // ChildImpl::Context implementation. |
- virtual ApplicationConnection* ShellConnection( |
- const mojo::String& application_url) OVERRIDE { |
- return app_->ConnectToApplication(application_url); |
+ // InterfaceProvider<Child> implementation. |
+ virtual void BindToRequest(ApplicationConnection* connection, |
+ InterfaceRequest<Child> request) OVERRIDE { |
+ mojo::BindToRequest(new ChildImpl(surfaces_service_connection_), &request); |
} |
private: |
- ApplicationImpl* app_; |
+ ApplicationConnection* surfaces_service_connection_; |
DISALLOW_COPY_AND_ASSIGN(ChildApp); |
}; |