| 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 0118208ce7349ace151d8899f48495c9eb461ff9..1b82cf9ac0489173f148364206146594b4cedc52 100644
|
| --- a/mojo/services/native_viewport/native_viewport_service.cc
|
| +++ b/mojo/services/native_viewport/native_viewport_service.cc
|
| @@ -28,13 +28,12 @@ bool IsRateLimitedEventType(ui::Event* event) {
|
| }
|
|
|
| class NativeViewportImpl
|
| - : public ServiceConnection<mojo::NativeViewport,
|
| - NativeViewportImpl,
|
| - shell::Context>,
|
| + : public InterfaceImpl<mojo::NativeViewport>,
|
| public NativeViewportDelegate {
|
| public:
|
| - NativeViewportImpl()
|
| - : widget_(gfx::kNullAcceleratedWidget),
|
| + NativeViewportImpl(shell::Context* context)
|
| + : context_(context),
|
| + widget_(gfx::kNullAcceleratedWidget),
|
| waiting_for_event_ack_(false) {}
|
| virtual ~NativeViewportImpl() {
|
| // Destroy the NativeViewport early on as it may call us back during
|
| @@ -42,9 +41,11 @@ class NativeViewportImpl
|
| native_viewport_.reset();
|
| }
|
|
|
| + virtual void OnConnectionError() OVERRIDE {}
|
| +
|
| virtual void Create(const Rect& bounds) OVERRIDE {
|
| native_viewport_ =
|
| - services::NativeViewport::Create(context(), this);
|
| + services::NativeViewport::Create(context_, this);
|
| native_viewport_->Init(bounds);
|
| client()->OnCreated();
|
| OnBoundsChanged(bounds);
|
| @@ -174,6 +175,7 @@ class NativeViewportImpl
|
| }
|
|
|
| private:
|
| + shell::Context* context_;
|
| gfx::AcceleratedWidget widget_;
|
| scoped_ptr<services::NativeViewport> native_viewport_;
|
| ScopedMessagePipeHandle command_buffer_handle_;
|
| @@ -189,9 +191,7 @@ MOJO_NATIVE_VIEWPORT_EXPORT mojo::Application*
|
| CreateNativeViewportService(mojo::shell::Context* context,
|
| mojo::ScopedMessagePipeHandle shell_handle) {
|
| mojo::Application* app = new mojo::Application(shell_handle.Pass());
|
| - app->AddServiceConnector(
|
| - new mojo::ServiceConnector<mojo::services::NativeViewportImpl,
|
| - mojo::shell::Context>(context));
|
| + app->AddService<mojo::services::NativeViewportImpl>(context);
|
| return app;
|
| }
|
|
|
|
|