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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
16 #include "content/browser/frame_host/navigation_controller_android.h" | 16 #include "content/browser/frame_host/navigation_controller_android.h" |
17 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 17 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
| 22 class SynchronousCompositorClient; |
22 class WebContents; | 23 class WebContents; |
23 | 24 |
24 // Android wrapper around WebContents that provides safer passage from java and | 25 // Android wrapper around WebContents that provides safer passage from java and |
25 // back to native and provides java with a means of communicating with its | 26 // back to native and provides java with a means of communicating with its |
26 // native counterpart. | 27 // native counterpart. |
27 class CONTENT_EXPORT WebContentsAndroid | 28 class CONTENT_EXPORT WebContentsAndroid |
28 : public base::SupportsUserData::Data { | 29 : public base::SupportsUserData::Data { |
29 public: | 30 public: |
30 static bool Register(JNIEnv* env); | 31 static bool Register(JNIEnv* env); |
31 | 32 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 jfloat y_offset, | 113 jfloat y_offset, |
113 jfloat x_scroll); | 114 jfloat x_scroll); |
114 | 115 |
115 void ResumeMediaSession(JNIEnv* env, jobject obj); | 116 void ResumeMediaSession(JNIEnv* env, jobject obj); |
116 void SuspendMediaSession(JNIEnv* env, jobject obj); | 117 void SuspendMediaSession(JNIEnv* env, jobject obj); |
117 void StopMediaSession(JNIEnv* env, jobject obj); | 118 void StopMediaSession(JNIEnv* env, jobject obj); |
118 | 119 |
119 base::android::ScopedJavaLocalRef<jstring> GetEncoding(JNIEnv* env, | 120 base::android::ScopedJavaLocalRef<jstring> GetEncoding(JNIEnv* env, |
120 jobject obj) const; | 121 jobject obj) const; |
121 | 122 |
| 123 void set_synchronous_compositor_client(SynchronousCompositorClient* client) { |
| 124 synchronous_compositor_client_ = client; |
| 125 } |
| 126 SynchronousCompositorClient* synchronous_compositor_client() const { |
| 127 return synchronous_compositor_client_; |
| 128 } |
| 129 |
122 private: | 130 private: |
123 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid(); | 131 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid(); |
124 | 132 |
125 WebContents* web_contents_; | 133 WebContents* web_contents_; |
126 NavigationControllerAndroid navigation_controller_; | 134 NavigationControllerAndroid navigation_controller_; |
127 base::android::ScopedJavaGlobalRef<jobject> obj_; | 135 base::android::ScopedJavaGlobalRef<jobject> obj_; |
| 136 SynchronousCompositorClient* synchronous_compositor_client_; |
128 | 137 |
129 base::WeakPtrFactory<WebContentsAndroid> weak_factory_; | 138 base::WeakPtrFactory<WebContentsAndroid> weak_factory_; |
130 | 139 |
131 DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid); | 140 DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid); |
132 }; | 141 }; |
133 | 142 |
134 } // namespace content | 143 } // namespace content |
135 | 144 |
136 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ | 145 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ |
OLD | NEW |