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

Side by Side Diff: mojo/services/native_viewport/native_viewport_android.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_ANDROID_H_ 5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_ANDROID_H_
6 #define MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_ANDROID_H_ 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_ANDROID_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "mojo/services/native_viewport/native_viewport.h" 9 #include "mojo/services/native_viewport/native_viewport.h"
10 #include "ui/gfx/size.h"
11
12 namespace gpu {
13 class GLInProcessContext;
14 }
15 10
16 struct ANativeWindow; 11 struct ANativeWindow;
17 12
18 namespace mojo { 13 namespace mojo {
19 namespace services { 14 namespace services {
20 15
21 class NativeViewportAndroid : public NativeViewport { 16 class NativeViewportAndroid : public NativeViewport {
22 public: 17 public:
23 explicit NativeViewportAndroid(NativeViewportDelegate* delegate); 18 explicit NativeViewportAndroid(NativeViewportDelegate* delegate);
24 virtual ~NativeViewportAndroid(); 19 virtual ~NativeViewportAndroid();
25 20
26 base::WeakPtr<NativeViewportAndroid> GetWeakPtr() { 21 base::WeakPtr<NativeViewportAndroid> GetWeakPtr() {
27 return weak_factory_.GetWeakPtr(); 22 return weak_factory_.GetWeakPtr();
28 } 23 }
29 24
30 void OnNativeWindowCreated(ANativeWindow* window); 25 void OnNativeWindowCreated(ANativeWindow* window);
31 void OnNativeWindowDestroyed(); 26 void OnNativeWindowDestroyed();
32 void OnResized(const gfx::Size& size); 27 void OnResized(const gfx::Size& size);
33 28
34 private: 29 private:
35 // Overridden from NativeViewport: 30 // Overridden from NativeViewport:
36 virtual void Close() OVERRIDE; 31 virtual void Close() OVERRIDE;
37 32
38 void OnGLContextLost();
39 void ReleaseWindow(); 33 void ReleaseWindow();
40 34
41 NativeViewportDelegate* delegate_;
42 ANativeWindow* window_;
43 gfx::Size size_;
44 scoped_ptr<gpu::GLInProcessContext> gl_context_;
45
46 base::WeakPtrFactory<NativeViewportAndroid> weak_factory_; 35 base::WeakPtrFactory<NativeViewportAndroid> weak_factory_;
47 36
48 DISALLOW_COPY_AND_ASSIGN(NativeViewportAndroid); 37 DISALLOW_COPY_AND_ASSIGN(NativeViewportAndroid);
49 }; 38 };
50 39
51 40
52 } // namespace services 41 } // namespace services
53 } // namespace mojo 42 } // namespace mojo
54 43
55 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_ANDROID_H_ 44 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698