| 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 <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
| 13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/supports_user_data.h" | 17 #include "base/supports_user_data.h" |
| 18 #include "content/browser/frame_host/navigation_controller_android.h" | 18 #include "content/browser/frame_host/navigation_controller_android.h" |
| 19 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 19 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 class SynchronousCompositorClient; |
| 24 class WebContentsImpl; | 25 class WebContentsImpl; |
| 25 | 26 |
| 26 // Android wrapper around WebContents that provides safer passage from java and | 27 // Android wrapper around WebContents that provides safer passage from java and |
| 27 // back to native and provides java with a means of communicating with its | 28 // back to native and provides java with a means of communicating with its |
| 28 // native counterpart. | 29 // native counterpart. |
| 29 class CONTENT_EXPORT WebContentsAndroid | 30 class CONTENT_EXPORT WebContentsAndroid |
| 30 : public base::SupportsUserData::Data { | 31 : public base::SupportsUserData::Data { |
| 31 public: | 32 public: |
| 32 static bool Register(JNIEnv* env); | 33 static bool Register(JNIEnv* env); |
| 33 | 34 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 const base::android::JavaParamRef<jobject>& color_type, | 168 const base::android::JavaParamRef<jobject>& color_type, |
| 168 jfloat scale, | 169 jfloat scale, |
| 169 jfloat x, | 170 jfloat x, |
| 170 jfloat y, | 171 jfloat y, |
| 171 jfloat width, | 172 jfloat width, |
| 172 jfloat height); | 173 jfloat height); |
| 173 | 174 |
| 174 void ReloadLoFiImages(JNIEnv* env, | 175 void ReloadLoFiImages(JNIEnv* env, |
| 175 const base::android::JavaParamRef<jobject>& obj); | 176 const base::android::JavaParamRef<jobject>& obj); |
| 176 | 177 |
| 178 void set_synchronous_compositor_client(SynchronousCompositorClient* client) { |
| 179 synchronous_compositor_client_ = client; |
| 180 } |
| 181 SynchronousCompositorClient* synchronous_compositor_client() const { |
| 182 return synchronous_compositor_client_; |
| 183 } |
| 184 |
| 177 int DownloadImage(JNIEnv* env, | 185 int DownloadImage(JNIEnv* env, |
| 178 const base::android::JavaParamRef<jobject>& obj, | 186 const base::android::JavaParamRef<jobject>& obj, |
| 179 const base::android::JavaParamRef<jstring>& url, | 187 const base::android::JavaParamRef<jstring>& url, |
| 180 jboolean is_fav_icon, | 188 jboolean is_fav_icon, |
| 181 jint max_bitmap_size, | 189 jint max_bitmap_size, |
| 182 jboolean bypass_cache, | 190 jboolean bypass_cache, |
| 183 const base::android::JavaParamRef<jobject>& jcallback); | 191 const base::android::JavaParamRef<jobject>& jcallback); |
| 184 | 192 |
| 185 void SetMediaSession( | 193 void SetMediaSession( |
| 186 const base::android::ScopedJavaLocalRef<jobject>& j_media_session); | 194 const base::android::ScopedJavaLocalRef<jobject>& j_media_session); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 199 base::android::ScopedJavaGlobalRef<jobject>* callback, | 207 base::android::ScopedJavaGlobalRef<jobject>* callback, |
| 200 int id, | 208 int id, |
| 201 int http_status_code, | 209 int http_status_code, |
| 202 const GURL& url, | 210 const GURL& url, |
| 203 const std::vector<SkBitmap>& bitmaps, | 211 const std::vector<SkBitmap>& bitmaps, |
| 204 const std::vector<gfx::Size>& sizes); | 212 const std::vector<gfx::Size>& sizes); |
| 205 | 213 |
| 206 WebContentsImpl* web_contents_; | 214 WebContentsImpl* web_contents_; |
| 207 NavigationControllerAndroid navigation_controller_; | 215 NavigationControllerAndroid navigation_controller_; |
| 208 base::android::ScopedJavaGlobalRef<jobject> obj_; | 216 base::android::ScopedJavaGlobalRef<jobject> obj_; |
| 217 SynchronousCompositorClient* synchronous_compositor_client_; |
| 209 | 218 |
| 210 base::WeakPtrFactory<WebContentsAndroid> weak_factory_; | 219 base::WeakPtrFactory<WebContentsAndroid> weak_factory_; |
| 211 | 220 |
| 212 DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid); | 221 DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid); |
| 213 }; | 222 }; |
| 214 | 223 |
| 215 } // namespace content | 224 } // namespace content |
| 216 | 225 |
| 217 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ | 226 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ |
| OLD | NEW |