| 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 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 // |handler| is an instance of | 84 // |handler| is an instance of |
| 85 // org.chromium.android_webview.AwHttpAuthHandler. | 85 // org.chromium.android_webview.AwHttpAuthHandler. |
| 86 bool OnReceivedHttpAuthRequest(const base::android::JavaRef<jobject>& handler, | 86 bool OnReceivedHttpAuthRequest(const base::android::JavaRef<jobject>& handler, |
| 87 const std::string& host, | 87 const std::string& host, |
| 88 const std::string& realm); | 88 const std::string& realm); |
| 89 | 89 |
| 90 void SetOffscreenPreRaster(bool enabled); | 90 void SetOffscreenPreRaster(bool enabled); |
| 91 | 91 |
| 92 void CreateSharedRendererState(); |
| 93 |
| 92 // Methods called from Java. | 94 // Methods called from Java. |
| 93 void SetJavaPeers( | 95 void SetJavaPeers( |
| 94 JNIEnv* env, | 96 JNIEnv* env, |
| 95 const base::android::JavaParamRef<jobject>& obj, | 97 const base::android::JavaParamRef<jobject>& obj, |
| 96 const base::android::JavaParamRef<jobject>& aw_contents, | 98 const base::android::JavaParamRef<jobject>& aw_contents, |
| 97 const base::android::JavaParamRef<jobject>& web_contents_delegate, | 99 const base::android::JavaParamRef<jobject>& web_contents_delegate, |
| 98 const base::android::JavaParamRef<jobject>& contents_client_bridge, | 100 const base::android::JavaParamRef<jobject>& contents_client_bridge, |
| 99 const base::android::JavaParamRef<jobject>& io_thread_client, | 101 const base::android::JavaParamRef<jobject>& io_thread_client, |
| 100 const base::android::JavaParamRef<jobject>& | 102 const base::android::JavaParamRef<jobject>& |
| 101 intercept_navigation_delegate); | 103 intercept_navigation_delegate); |
| 104 jlong CreateSharedRendererState( |
| 105 JNIEnv* env, |
| 106 const base::android::JavaParamRef<jobject>& obj); |
| 102 base::android::ScopedJavaLocalRef<jobject> GetWebContents( | 107 base::android::ScopedJavaLocalRef<jobject> GetWebContents( |
| 103 JNIEnv* env, | 108 JNIEnv* env, |
| 104 const base::android::JavaParamRef<jobject>& obj); | 109 const base::android::JavaParamRef<jobject>& obj); |
| 105 | 110 |
| 106 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 111 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 107 void DocumentHasImages(JNIEnv* env, | 112 void DocumentHasImages(JNIEnv* env, |
| 108 const base::android::JavaParamRef<jobject>& obj, | 113 const base::android::JavaParamRef<jobject>& obj, |
| 109 const base::android::JavaParamRef<jobject>& message); | 114 const base::android::JavaParamRef<jobject>& message); |
| 110 void GenerateMHTML(JNIEnv* env, | 115 void GenerateMHTML(JNIEnv* env, |
| 111 const base::android::JavaParamRef<jobject>& obj, | 116 const base::android::JavaParamRef<jobject>& obj, |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 private: | 340 private: |
| 336 void InitAutofillIfNecessary(bool enabled); | 341 void InitAutofillIfNecessary(bool enabled); |
| 337 | 342 |
| 338 // Geolocation API support | 343 // Geolocation API support |
| 339 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); | 344 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); |
| 340 void HideGeolocationPrompt(const GURL& origin); | 345 void HideGeolocationPrompt(const GURL& origin); |
| 341 | 346 |
| 342 void SetDipScaleInternal(float dip_scale); | 347 void SetDipScaleInternal(float dip_scale); |
| 343 | 348 |
| 344 JavaObjectWeakGlobalRef java_ref_; | 349 JavaObjectWeakGlobalRef java_ref_; |
| 345 SharedRendererState shared_renderer_state_; | 350 SharedRendererState* shared_renderer_state_; |
| 346 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. | 351 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. |
| 347 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 352 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
| 348 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; | 353 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; |
| 349 scoped_ptr<content::WebContents> web_contents_; | 354 scoped_ptr<content::WebContents> web_contents_; |
| 350 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; | 355 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
| 351 scoped_ptr<FindHelper> find_helper_; | 356 scoped_ptr<FindHelper> find_helper_; |
| 352 scoped_ptr<IconHelper> icon_helper_; | 357 scoped_ptr<IconHelper> icon_helper_; |
| 353 scoped_ptr<AwContents> pending_contents_; | 358 scoped_ptr<AwContents> pending_contents_; |
| 354 scoped_ptr<AwPdfExporter> pdf_exporter_; | 359 scoped_ptr<AwPdfExporter> pdf_exporter_; |
| 355 scoped_ptr<PermissionRequestHandler> permission_request_handler_; | 360 scoped_ptr<PermissionRequestHandler> permission_request_handler_; |
| 356 scoped_refptr<AwMessagePortMessageFilter> message_port_message_filter_; | 361 scoped_refptr<AwMessagePortMessageFilter> message_port_message_filter_; |
| 357 | 362 |
| 358 // GURL is supplied by the content layer as requesting frame. | 363 // GURL is supplied by the content layer as requesting frame. |
| 359 // Callback is supplied by the content layer, and is invoked with the result | 364 // Callback is supplied by the content layer, and is invoked with the result |
| 360 // from the permission prompt. | 365 // from the permission prompt. |
| 361 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; | 366 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; |
| 362 // The first element in the list is always the currently pending request. | 367 // The first element in the list is always the currently pending request. |
| 363 std::list<OriginCallback> pending_geolocation_prompts_; | 368 std::list<OriginCallback> pending_geolocation_prompts_; |
| 364 | 369 |
| 365 GLViewRendererManager::Key renderer_manager_key_; | 370 GLViewRendererManager::Key renderer_manager_key_; |
| 366 | 371 |
| 367 DISALLOW_COPY_AND_ASSIGN(AwContents); | 372 DISALLOW_COPY_AND_ASSIGN(AwContents); |
| 368 }; | 373 }; |
| 369 | 374 |
| 370 bool RegisterAwContents(JNIEnv* env); | 375 bool RegisterAwContents(JNIEnv* env); |
| 371 | 376 |
| 372 } // namespace android_webview | 377 } // namespace android_webview |
| 373 | 378 |
| 374 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 379 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
| OLD | NEW |