| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ | |
| 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "mojo/public/bindings/lib/remote_ptr.h" | |
| 11 #include "mojo/public/system/core_cpp.h" | |
| 12 #include "mojo/services/native_viewport/native_viewport.h" | |
| 13 #include "mojom/native_viewport.h" | |
| 14 | |
| 15 namespace gpu { | |
| 16 class GLInProcessContext; | |
| 17 } | |
| 18 | |
| 19 namespace mojo { | |
| 20 namespace services { | |
| 21 class GLES2Impl; | |
| 22 | |
| 23 class NativeViewportImpl : public NativeViewportStub, | |
| 24 public NativeViewportDelegate { | |
| 25 public: | |
| 26 NativeViewportImpl(shell::Context* context, | |
| 27 ScopedMessagePipeHandle pipe); | |
| 28 virtual ~NativeViewportImpl(); | |
| 29 | |
| 30 virtual void Open() OVERRIDE; | |
| 31 virtual void Close() OVERRIDE; | |
| 32 virtual void CreateGLES2Context( | |
| 33 ScopedMessagePipeHandle gles2_client) OVERRIDE; | |
| 34 | |
| 35 private: | |
| 36 // Overridden from services::NativeViewportDelegate: | |
| 37 virtual void OnResized(const gfx::Size& size) OVERRIDE; | |
| 38 virtual void OnAcceleratedWidgetAvailable( | |
| 39 gfx::AcceleratedWidget widget) OVERRIDE; | |
| 40 virtual bool OnEvent(ui::Event* ui_event) OVERRIDE; | |
| 41 virtual void OnDestroyed() OVERRIDE; | |
| 42 | |
| 43 void CreateGLES2ContextIfNeeded(); | |
| 44 | |
| 45 shell::Context* context_; | |
| 46 gfx::AcceleratedWidget widget_; | |
| 47 scoped_ptr<services::NativeViewport> native_viewport_; | |
| 48 scoped_ptr<GLES2Impl> gles2_; | |
| 49 | |
| 50 RemotePtr<NativeViewportClient> client_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(NativeViewportImpl); | |
| 53 }; | |
| 54 | |
| 55 } // namespace services | |
| 56 } // namespace mojo | |
| 57 | |
| 58 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_ | |
| OLD | NEW |