Index: mojo/examples/surfaces_app/child_impl.cc |
diff --git a/mojo/examples/surfaces_app/child_impl.cc b/mojo/examples/surfaces_app/child_impl.cc |
index 2d5140a7248d7581e2d41cdbeb8750ffceb72d97..e84e933f67b03f55bd95e4acee0c86f2d1c25829 100644 |
--- a/mojo/examples/surfaces_app/child_impl.cc |
+++ b/mojo/examples/surfaces_app/child_impl.cc |
@@ -27,30 +27,9 @@ using cc::SolidColorDrawQuad; |
using cc::DelegatedFrameData; |
using cc::CompositorFrame; |
-class SurfaceClientImpl : public surfaces::SurfaceClient { |
- public: |
- explicit SurfaceClientImpl(ChildImpl* impl) : impl_(impl) {} |
- virtual ~SurfaceClientImpl() {} |
- |
- // surfaces::SurfaceClient implementation |
- virtual void SetIdNamespace(uint32_t id_namespace) OVERRIDE { |
- impl_->SetIdNamespace(id_namespace); |
- } |
- |
- virtual void ReturnResources( |
- Array<surfaces::ReturnedResourcePtr> resources) OVERRIDE { |
- DCHECK(!resources.size()); |
- } |
- |
- private: |
- ChildImpl* impl_; |
-}; |
- |
-ChildImpl::ChildImpl(ApplicationConnection* connection, Context* context) |
- : surface_client_(new SurfaceClientImpl(this)) { |
- context->ShellConnection("mojo:mojo_surfaces_service") |
- ->ConnectToService(&surface_); |
- surface_.set_client(surface_client_.get()); |
+ChildImpl::ChildImpl(ApplicationConnection* surfaces_service_connection) { |
+ surfaces_service_connection->ConnectToService(&surface_); |
+ surface_.set_client(this); |
} |
ChildImpl::~ChildImpl() { |
@@ -74,6 +53,11 @@ void ChildImpl::SetIdNamespace(uint32_t id_namespace) { |
Draw(); |
} |
+void ChildImpl::ReturnResources( |
+ Array<surfaces::ReturnedResourcePtr> resources) { |
+ DCHECK(!resources.size()); |
+} |
+ |
void ChildImpl::Draw() { |
id_ = allocator_->GenerateId(); |
surface_->CreateSurface(mojo::surfaces::SurfaceId::From(id_), |