Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: mojo/services/native_viewport/native_viewport.h

Issue 59383011: Factor common code into native_viewport_controller.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix X11 Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/rect.h"
11 class Size;
12 }
13 11
14 namespace gpu { 12 namespace gpu {
13 class GLInProcessContext;
15 namespace gles2 { 14 namespace gles2 {
16 class GLES2Interface; 15 class GLES2Interface;
17 } 16 }
18 } 17 }
19 18
20 namespace ui { 19 namespace ui {
21 class Event; 20 class Event;
22 } 21 }
23 22
24 namespace mojo { 23 namespace mojo {
(...skipping 10 matching lines...) Expand all
35 virtual bool OnEvent(ui::Event* event) = 0; 34 virtual bool OnEvent(ui::Event* event) = 0;
36 virtual void OnDestroyed() = 0; 35 virtual void OnDestroyed() = 0;
37 virtual void OnGLContextAvailable(gpu::gles2::GLES2Interface* gl) = 0; 36 virtual void OnGLContextAvailable(gpu::gles2::GLES2Interface* gl) = 0;
38 virtual void OnGLContextLost() = 0; 37 virtual void OnGLContextLost() = 0;
39 virtual void OnResized(const gfx::Size& size) = 0; 38 virtual void OnResized(const gfx::Size& size) = 0;
40 }; 39 };
41 40
42 // Encapsulation of platform-specific Viewport. 41 // Encapsulation of platform-specific Viewport.
43 class NativeViewport { 42 class NativeViewport {
44 public: 43 public:
45 virtual ~NativeViewport() {} 44 virtual ~NativeViewport();
46 45
47 virtual void Close() = 0; 46 virtual void Close() = 0;
48 47
49 static scoped_ptr<NativeViewport> Create(shell::Context* context, 48 static scoped_ptr<NativeViewport> Create(shell::Context* context,
50 NativeViewportDelegate* delegate); 49 NativeViewportDelegate* delegate);
50
51 protected:
52 explicit NativeViewport(NativeViewportDelegate* delegate);
53
54 void OnAcceleratedWidgetAvailable();
Ben Goodger (Google) 2013/11/06 07:17:17 wdyt about this stuff being the responsibility of
abarth-chromium 2013/11/06 15:40:55 It depends on whether we're going to have the obje
55 void OnGLContextLost();
56
57 NativeViewportDelegate* delegate_;
58 gfx::Rect bounds_;
59 gfx::AcceleratedWidget widget_;
60 scoped_ptr<gpu::GLInProcessContext> gl_context_;
51 }; 61 };
52 62
53 } // namespace services 63 } // namespace services
54 } // namespace mojo 64 } // namespace mojo
55 65
56 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_ 66 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698