OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ | 5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ |
6 #define MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ | 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 | 9 #include "ui/gfx/native_widget_types.h" |
10 namespace gfx { | 10 #include "ui/gfx/size.h" |
11 class Size; | |
12 } | |
13 | |
14 namespace gpu { | |
15 namespace gles2 { | |
16 class GLES2Interface; | |
17 } | |
18 } | |
19 | 11 |
20 namespace ui { | 12 namespace ui { |
21 class Event; | 13 class Event; |
22 } | 14 } |
23 | 15 |
24 namespace mojo { | 16 namespace mojo { |
25 namespace shell { | 17 namespace shell { |
26 class Context; | 18 class Context; |
27 } | 19 } |
28 | 20 |
29 namespace services { | 21 namespace services { |
30 | 22 |
31 class NativeViewportDelegate { | 23 class NativeViewportDelegate { |
32 public: | 24 public: |
33 virtual ~NativeViewportDelegate() {} | 25 virtual ~NativeViewportDelegate() {} |
34 | 26 |
| 27 virtual void OnResized(const gfx::Size& size) = 0; |
| 28 virtual void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) = 0; |
35 virtual bool OnEvent(ui::Event* event) = 0; | 29 virtual bool OnEvent(ui::Event* event) = 0; |
36 virtual void OnDestroyed() = 0; | 30 virtual void OnDestroyed() = 0; |
37 virtual void OnGLContextAvailable(gpu::gles2::GLES2Interface* gl) = 0; | |
38 virtual void OnGLContextLost() = 0; | |
39 virtual void OnResized(const gfx::Size& size) = 0; | |
40 }; | 31 }; |
41 | 32 |
42 // Encapsulation of platform-specific Viewport. | 33 // Encapsulation of platform-specific Viewport. |
43 class NativeViewport { | 34 class NativeViewport { |
44 public: | 35 public: |
45 virtual ~NativeViewport() {} | 36 virtual ~NativeViewport() {} |
46 | 37 |
| 38 virtual gfx::Size GetSize() = 0; |
47 virtual void Close() = 0; | 39 virtual void Close() = 0; |
48 | 40 |
49 static scoped_ptr<NativeViewport> Create(shell::Context* context, | 41 static scoped_ptr<NativeViewport> Create(shell::Context* context, |
50 NativeViewportDelegate* delegate); | 42 NativeViewportDelegate* delegate); |
51 }; | 43 }; |
52 | 44 |
53 } // namespace services | 45 } // namespace services |
54 } // namespace mojo | 46 } // namespace mojo |
55 | 47 |
56 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ | 48 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ |
OLD | NEW |