| Index: mojo/services/native_viewport/native_viewport_service.cc
|
| diff --git a/mojo/services/native_viewport/native_viewport_service.cc b/mojo/services/native_viewport/native_viewport_service.cc
|
| index 1db489b8375382e7f202a9674425047aa89350f3..666422186400102ef149a4027631d4f3f8898f73 100644
|
| --- a/mojo/services/native_viewport/native_viewport_service.cc
|
| +++ b/mojo/services/native_viewport/native_viewport_service.cc
|
| @@ -30,11 +30,10 @@ bool IsRateLimitedEventType(ui::Event* event) {
|
| } // namespace
|
|
|
| class NativeViewportImpl
|
| - : public InterfaceImpl<mojo::NativeViewport>,
|
| + : public InterfaceImplDeleteOnError<mojo::NativeViewport>,
|
| public NativeViewportDelegate {
|
| public:
|
| - NativeViewportImpl(ApplicationConnection* connection,
|
| - shell::Context* context)
|
| + explicit NativeViewportImpl(shell::Context* context)
|
| : context_(context),
|
| widget_(gfx::kNullAcceleratedWidget),
|
| waiting_for_event_ack_(false),
|
| @@ -152,17 +151,26 @@ class NativeViewportImpl
|
| base::WeakPtrFactory<NativeViewportImpl> weak_factory_;
|
| };
|
|
|
| -class NVSDelegate : public ApplicationDelegate {
|
| +class NVSDelegate : public ApplicationDelegate,
|
| + public InterfaceProvider<mojo::NativeViewport> {
|
| public:
|
| NVSDelegate(shell::Context* context) : context_(context) {}
|
| virtual ~NVSDelegate() {}
|
|
|
| + // ApplicationDelegate implementation.
|
| virtual bool ConfigureIncomingConnection(
|
| - mojo::ApplicationConnection* connection) MOJO_OVERRIDE {
|
| - connection->AddService<NativeViewportImpl>(context_);
|
| + ApplicationConnection* connection) OVERRIDE {
|
| + connection->AddServiceProvider(this);
|
| return true;
|
| }
|
|
|
| + // InterfaceProvider<mojo::NativeViewport> implementation.
|
| + virtual void BindToRequest(
|
| + ApplicationConnection* connection,
|
| + InterfaceRequest<mojo::NativeViewport> request) OVERRIDE {
|
| + mojo::BindToRequest(new NativeViewportImpl(context_), &request);
|
| + }
|
| +
|
| private:
|
| mojo::shell::Context* context_;
|
| };
|
|
|