| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | 13 #include <utility> |
| 14 | 14 |
| 15 #include "android_webview/browser/aw_browser_permission_request_delegate.h" | 15 #include "android_webview/browser/aw_browser_permission_request_delegate.h" |
| 16 #include "android_webview/browser/aw_message_port_message_filter.h" | 16 #include "android_webview/browser/aw_message_port_message_filter.h" |
| 17 #include "android_webview/browser/browser_view_renderer.h" | 17 #include "android_webview/browser/browser_view_renderer.h" |
| 18 #include "android_webview/browser/browser_view_renderer_client.h" | 18 #include "android_webview/browser/browser_view_renderer_client.h" |
| 19 #include "android_webview/browser/find_helper.h" | 19 #include "android_webview/browser/find_helper.h" |
| 20 #include "android_webview/browser/gl_view_renderer_manager.h" | 20 #include "android_webview/browser/gl_view_renderer_manager.h" |
| 21 #include "android_webview/browser/icon_helper.h" | 21 #include "android_webview/browser/icon_helper.h" |
| 22 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 22 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
| 23 #include "android_webview/browser/shared_renderer_state.h" | |
| 24 #include "android_webview/browser/shared_renderer_state_client.h" | 23 #include "android_webview/browser/shared_renderer_state_client.h" |
| 25 #include "android_webview/native/permission/permission_request_handler_client.h" | 24 #include "android_webview/native/permission/permission_request_handler_client.h" |
| 26 #include "base/android/jni_weak_ref.h" | 25 #include "base/android/jni_weak_ref.h" |
| 27 #include "base/android/scoped_java_ref.h" | 26 #include "base/android/scoped_java_ref.h" |
| 28 #include "base/callback_forward.h" | 27 #include "base/callback_forward.h" |
| 29 #include "base/macros.h" | 28 #include "base/macros.h" |
| 30 | 29 |
| 31 class SkBitmap; | 30 class SkBitmap; |
| 32 class TabContents; | 31 class TabContents; |
| 33 struct AwDrawGLInfo; | 32 struct AwDrawGLInfo; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 bool OnDraw(JNIEnv* env, | 169 bool OnDraw(JNIEnv* env, |
| 171 const base::android::JavaParamRef<jobject>& obj, | 170 const base::android::JavaParamRef<jobject>& obj, |
| 172 const base::android::JavaParamRef<jobject>& canvas, | 171 const base::android::JavaParamRef<jobject>& canvas, |
| 173 jboolean is_hardware_accelerated, | 172 jboolean is_hardware_accelerated, |
| 174 jint scroll_x, | 173 jint scroll_x, |
| 175 jint scroll_y, | 174 jint scroll_y, |
| 176 jint visible_left, | 175 jint visible_left, |
| 177 jint visible_top, | 176 jint visible_top, |
| 178 jint visible_right, | 177 jint visible_right, |
| 179 jint visible_bottom); | 178 jint visible_bottom); |
| 180 jlong GetAwDrawGLViewContext(JNIEnv* env, | |
| 181 const base::android::JavaParamRef<jobject>& obj); | |
| 182 jlong CapturePicture(JNIEnv* env, | 179 jlong CapturePicture(JNIEnv* env, |
| 183 const base::android::JavaParamRef<jobject>& obj, | 180 const base::android::JavaParamRef<jobject>& obj, |
| 184 int width, | 181 int width, |
| 185 int height); | 182 int height); |
| 186 void EnableOnNewPicture(JNIEnv* env, | 183 void EnableOnNewPicture(JNIEnv* env, |
| 187 const base::android::JavaParamRef<jobject>& obj, | 184 const base::android::JavaParamRef<jobject>& obj, |
| 188 jboolean enabled); | 185 jboolean enabled); |
| 189 void InsertVisualStateCallback( | 186 void InsertVisualStateCallback( |
| 190 JNIEnv* env, | 187 JNIEnv* env, |
| 191 const base::android::JavaParamRef<jobject>& obj, | 188 const base::android::JavaParamRef<jobject>& obj, |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 private: | 334 private: |
| 338 void InitAutofillIfNecessary(bool enabled); | 335 void InitAutofillIfNecessary(bool enabled); |
| 339 | 336 |
| 340 // Geolocation API support | 337 // Geolocation API support |
| 341 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); | 338 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); |
| 342 void HideGeolocationPrompt(const GURL& origin); | 339 void HideGeolocationPrompt(const GURL& origin); |
| 343 | 340 |
| 344 void SetDipScaleInternal(float dip_scale); | 341 void SetDipScaleInternal(float dip_scale); |
| 345 | 342 |
| 346 JavaObjectWeakGlobalRef java_ref_; | 343 JavaObjectWeakGlobalRef java_ref_; |
| 347 SharedRendererState shared_renderer_state_; | |
| 348 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. | 344 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. |
| 349 std::unique_ptr<AwWebContentsDelegate> web_contents_delegate_; | 345 std::unique_ptr<AwWebContentsDelegate> web_contents_delegate_; |
| 350 std::unique_ptr<AwContentsClientBridge> contents_client_bridge_; | 346 std::unique_ptr<AwContentsClientBridge> contents_client_bridge_; |
| 351 std::unique_ptr<content::WebContents> web_contents_; | 347 std::unique_ptr<content::WebContents> web_contents_; |
| 352 std::unique_ptr<AwRenderViewHostExt> render_view_host_ext_; | 348 std::unique_ptr<AwRenderViewHostExt> render_view_host_ext_; |
| 353 std::unique_ptr<FindHelper> find_helper_; | 349 std::unique_ptr<FindHelper> find_helper_; |
| 354 std::unique_ptr<IconHelper> icon_helper_; | 350 std::unique_ptr<IconHelper> icon_helper_; |
| 355 std::unique_ptr<AwContents> pending_contents_; | 351 std::unique_ptr<AwContents> pending_contents_; |
| 356 std::unique_ptr<AwPdfExporter> pdf_exporter_; | 352 std::unique_ptr<AwPdfExporter> pdf_exporter_; |
| 357 std::unique_ptr<PermissionRequestHandler> permission_request_handler_; | 353 std::unique_ptr<PermissionRequestHandler> permission_request_handler_; |
| 358 scoped_refptr<AwMessagePortMessageFilter> message_port_message_filter_; | 354 scoped_refptr<AwMessagePortMessageFilter> message_port_message_filter_; |
| 359 | 355 |
| 360 // GURL is supplied by the content layer as requesting frame. | 356 // GURL is supplied by the content layer as requesting frame. |
| 361 // Callback is supplied by the content layer, and is invoked with the result | 357 // Callback is supplied by the content layer, and is invoked with the result |
| 362 // from the permission prompt. | 358 // from the permission prompt. |
| 363 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; | 359 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; |
| 364 // The first element in the list is always the currently pending request. | 360 // The first element in the list is always the currently pending request. |
| 365 std::list<OriginCallback> pending_geolocation_prompts_; | 361 std::list<OriginCallback> pending_geolocation_prompts_; |
| 366 | 362 |
| 367 GLViewRendererManager::Key renderer_manager_key_; | 363 GLViewRendererManager::Key renderer_manager_key_; |
| 368 | 364 |
| 369 DISALLOW_COPY_AND_ASSIGN(AwContents); | 365 DISALLOW_COPY_AND_ASSIGN(AwContents); |
| 370 }; | 366 }; |
| 371 | 367 |
| 372 bool RegisterAwContents(JNIEnv* env); | 368 bool RegisterAwContents(JNIEnv* env); |
| 373 | 369 |
| 374 } // namespace android_webview | 370 } // namespace android_webview |
| 375 | 371 |
| 376 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 372 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| OLD | NEW |