- add sources.
[platform/framework/web/crosswalk.git] / src / mojo / services / native_viewport / native_viewport.h
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_H_
6 #define MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_
7
8 #include "base/memory/scoped_ptr.h"
9
10 namespace gfx {
11 class Size;
12 }
13
14 namespace gpu {
15 namespace gles2 {
16 class GLES2Interface;
17 }
18 }
19
20 namespace ui {
21 class Event;
22 }
23
24 namespace mojo {
25 namespace shell {
26 class Context;
27 }
28
29 namespace services {
30
31 class NativeViewportDelegate {
32  public:
33   virtual ~NativeViewportDelegate() {}
34
35   virtual bool OnEvent(ui::Event* event) = 0;
36   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 };
41
42 // Encapsulation of platform-specific Viewport.
43 class NativeViewport {
44  public:
45   virtual ~NativeViewport() {}
46
47   virtual void Close() = 0;
48
49   static scoped_ptr<NativeViewport> Create(shell::Context* context,
50                                            NativeViewportDelegate* delegate);
51 };
52
53 }  // namespace services
54 }  // namespace mojo
55
56 #endif  // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_