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

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

Issue 404913002: Break dependency of native_viewport_service on mojo::shell::Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 6 years, 5 months 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/android/jni_weak_ref.h" 8 #include "base/android/jni_weak_ref.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 11 matching lines...) Expand all
22 struct ANativeWindow; 22 struct ANativeWindow;
23 23
24 namespace mojo { 24 namespace mojo {
25 namespace services { 25 namespace services {
26 26
27 class MOJO_NATIVE_VIEWPORT_EXPORT NativeViewportAndroid 27 class MOJO_NATIVE_VIEWPORT_EXPORT NativeViewportAndroid
28 : public NativeViewport { 28 : public NativeViewport {
29 public: 29 public:
30 static MOJO_NATIVE_VIEWPORT_EXPORT bool Register(JNIEnv* env); 30 static MOJO_NATIVE_VIEWPORT_EXPORT bool Register(JNIEnv* env);
31 31
32 explicit NativeViewportAndroid(shell::Context* context, 32 explicit NativeViewportAndroid(NativeViewportContext* context,
33 NativeViewportDelegate* delegate); 33 NativeViewportDelegate* delegate);
34 virtual ~NativeViewportAndroid(); 34 virtual ~NativeViewportAndroid();
35 35
36 void Destroy(JNIEnv* env, jobject obj); 36 void Destroy(JNIEnv* env, jobject obj);
37 void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface); 37 void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface);
38 void SurfaceDestroyed(JNIEnv* env, jobject obj); 38 void SurfaceDestroyed(JNIEnv* env, jobject obj);
39 void SurfaceSetSize(JNIEnv* env, jobject obj, jint width, jint height); 39 void SurfaceSetSize(JNIEnv* env, jobject obj, jint width, jint height);
40 bool TouchEvent(JNIEnv* env, jobject obj, jint pointer_id, jint action, 40 bool TouchEvent(JNIEnv* env, jobject obj, jint pointer_id, jint action,
41 jfloat x, jfloat y, jlong time_ms); 41 jfloat x, jfloat y, jlong time_ms);
42 42
43 private: 43 private:
44 // Overridden from NativeViewport: 44 // Overridden from NativeViewport:
45 virtual void Init(const gfx::Rect& bounds) OVERRIDE; 45 virtual void Init(const gfx::Rect& bounds) OVERRIDE;
46 virtual void Show() OVERRIDE; 46 virtual void Show() OVERRIDE;
47 virtual void Hide() OVERRIDE; 47 virtual void Hide() OVERRIDE;
48 virtual void Close() OVERRIDE; 48 virtual void Close() OVERRIDE;
49 virtual gfx::Size GetSize() OVERRIDE; 49 virtual gfx::Size GetSize() OVERRIDE;
50 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; 50 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
51 virtual void SetCapture() OVERRIDE; 51 virtual void SetCapture() OVERRIDE;
52 virtual void ReleaseCapture() OVERRIDE; 52 virtual void ReleaseCapture() OVERRIDE;
53 53
54 void ReleaseWindow(); 54 void ReleaseWindow();
55 55
56 NativeViewportDelegate* delegate_; 56 NativeViewportDelegate* delegate_;
57 shell::Context* context_; 57 NativeViewportContext* context_;
58 ANativeWindow* window_; 58 ANativeWindow* window_;
59 gfx::Rect bounds_; 59 gfx::Rect bounds_;
60 ui::SequentialIDGenerator id_generator_; 60 ui::SequentialIDGenerator id_generator_;
61 61
62 base::WeakPtrFactory<NativeViewportAndroid> weak_factory_; 62 base::WeakPtrFactory<NativeViewportAndroid> weak_factory_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(NativeViewportAndroid); 64 DISALLOW_COPY_AND_ASSIGN(NativeViewportAndroid);
65 }; 65 };
66 66
67 67
68 } // namespace services 68 } // namespace services
69 } // namespace mojo 69 } // namespace mojo
70 70
71 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_ANDROID_H_ 71 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698