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 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 class Event; | 13 class Event; |
14 } | 14 } |
15 | 15 |
16 namespace mojo { | 16 namespace mojo { |
17 namespace shell { | 17 namespace shell { |
18 class Context; | 18 class Context; |
19 } | 19 } |
20 | 20 |
21 namespace services { | 21 namespace services { |
22 | 22 |
23 class NativeViewportDelegate { | 23 class NativeViewportDelegate { |
24 public: | 24 public: |
25 virtual ~NativeViewportDelegate() {} | 25 virtual ~NativeViewportDelegate() {} |
26 | 26 |
27 virtual void OnResized(const gfx::Size& size) = 0; | 27 virtual void OnResized(const gfx::Size& size) = 0; |
28 virtual void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) = 0; | 28 virtual void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) = 0; |
29 virtual bool OnEvent(ui::Event* event) = 0; | 29 virtual bool OnEvent(ui::Event* ui_event) = 0; |
30 virtual void OnDestroyed() = 0; | 30 virtual void OnDestroyed() = 0; |
31 }; | 31 }; |
32 | 32 |
33 // Encapsulation of platform-specific Viewport. | 33 // Encapsulation of platform-specific Viewport. |
34 // TODO(abarth): Rename this class so that it doesn't conflict with the name of | 34 // TODO(abarth): Rename this class so that it doesn't conflict with the name of |
35 // the service. | 35 // the service. |
36 class NativeViewport { | 36 class NativeViewport { |
37 public: | 37 public: |
38 virtual ~NativeViewport() {} | 38 virtual ~NativeViewport() {} |
39 | 39 |
40 virtual void Init() = 0; | 40 virtual void Init() = 0; |
41 virtual void Close() = 0; | 41 virtual void Close() = 0; |
42 virtual gfx::Size GetSize() = 0; | 42 virtual gfx::Size GetSize() = 0; |
43 | 43 |
44 static scoped_ptr<NativeViewport> Create(shell::Context* context, | 44 static scoped_ptr<NativeViewport> Create(shell::Context* context, |
45 NativeViewportDelegate* delegate); | 45 NativeViewportDelegate* delegate); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace services | 48 } // namespace services |
49 } // namespace mojo | 49 } // namespace mojo |
50 | 50 |
51 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ | 51 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ |
OLD | NEW |