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 #include "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include <sys/system_properties.h> | 7 #include <sys/system_properties.h> |
8 | 8 |
| 9 #include "android_webview/browser/aw_browser_context.h" |
9 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
| 11 #include "android_webview/browser/aw_content_browser_client.h" |
10 #include "android_webview/browser/net_disk_cache_remover.h" | 12 #include "android_webview/browser/net_disk_cache_remover.h" |
11 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 13 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
12 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 14 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
13 #include "android_webview/common/aw_hit_test_data.h" | 15 #include "android_webview/common/aw_hit_test_data.h" |
14 #include "android_webview/native/aw_browser_dependency_factory.h" | 16 #include "android_webview/native/aw_browser_dependency_factory.h" |
15 #include "android_webview/native/aw_contents_io_thread_client_impl.h" | 17 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
16 #include "android_webview/native/aw_web_contents_delegate.h" | 18 #include "android_webview/native/aw_web_contents_delegate.h" |
17 #include "android_webview/native/state_serializer.h" | 19 #include "android_webview/native/state_serializer.h" |
18 #include "android_webview/public/browser/draw_sw.h" | 20 #include "android_webview/public/browser/draw_sw.h" |
19 #include "base/android/jni_android.h" | 21 #include "base/android/jni_android.h" |
20 #include "base/android/jni_array.h" | 22 #include "base/android/jni_array.h" |
21 #include "base/android/jni_string.h" | 23 #include "base/android/jni_string.h" |
22 #include "base/bind.h" | 24 #include "base/bind.h" |
23 #include "base/callback.h" | 25 #include "base/callback.h" |
24 #include "base/debug/trace_event.h" | 26 #include "base/debug/trace_event.h" |
25 #include "base/message_loop.h" | 27 #include "base/message_loop.h" |
26 #include "base/pickle.h" | 28 #include "base/pickle.h" |
27 #include "base/supports_user_data.h" | 29 #include "base/supports_user_data.h" |
28 #include "cc/layer.h" | 30 #include "cc/layer.h" |
29 #include "content/components/navigation_interception/intercept_navigation_delega
te.h" | 31 #include "content/components/navigation_interception/intercept_navigation_delega
te.h" |
30 #include "content/public/browser/android/content_view_core.h" | 32 #include "content/public/browser/android/content_view_core.h" |
| 33 #include "content/public/browser/browser_context.h" |
31 #include "content/public/browser/browser_thread.h" | 34 #include "content/public/browser/browser_thread.h" |
32 #include "content/public/browser/cert_store.h" | 35 #include "content/public/browser/cert_store.h" |
33 #include "content/public/browser/navigation_entry.h" | 36 #include "content/public/browser/navigation_entry.h" |
34 #include "content/public/browser/render_process_host.h" | 37 #include "content/public/browser/render_process_host.h" |
35 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
36 #include "content/public/common/ssl_status.h" | 39 #include "content/public/common/ssl_status.h" |
37 #include "jni/AwContents_jni.h" | 40 #include "jni/AwContents_jni.h" |
38 #include "net/base/x509_certificate.h" | 41 #include "net/base/x509_certificate.h" |
39 #include "third_party/skia/include/core/SkBitmap.h" | 42 #include "third_party/skia/include/core/SkBitmap.h" |
40 #include "third_party/skia/include/core/SkCanvas.h" | 43 #include "third_party/skia/include/core/SkCanvas.h" |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 jboolean private_browsing) { | 643 jboolean private_browsing) { |
641 AwContents* tab = new AwContents(env, obj, web_contents_delegate, | 644 AwContents* tab = new AwContents(env, obj, web_contents_delegate, |
642 private_browsing); | 645 private_browsing); |
643 return reinterpret_cast<jint>(tab); | 646 return reinterpret_cast<jint>(tab); |
644 } | 647 } |
645 | 648 |
646 bool RegisterAwContents(JNIEnv* env) { | 649 bool RegisterAwContents(JNIEnv* env) { |
647 return RegisterNativesImpl(env) >= 0; | 650 return RegisterNativesImpl(env) >= 0; |
648 } | 651 } |
649 | 652 |
| 653 void AwContents::GeolocationShowPrompt(int render_process_id, |
| 654 int render_view_id, |
| 655 int bridge_id, |
| 656 const GURL& requesting_frame) { |
| 657 JNIEnv* env = AttachCurrentThread(); |
| 658 ScopedJavaLocalRef<jstring> j_requesting_frame( |
| 659 ConvertUTF8ToJavaString(env, requesting_frame.spec())); |
| 660 Java_AwContents_onGeolocationPermissionsShowPrompt(env, |
| 661 java_ref_.get(env).obj(), render_process_id, render_view_id, bridge_id, |
| 662 j_requesting_frame.obj()); |
| 663 } |
| 664 |
| 665 void AwContents::GeolocationHidePrompt() { |
| 666 } |
| 667 |
650 jint AwContents::FindAllSync(JNIEnv* env, jobject obj, jstring search_string) { | 668 jint AwContents::FindAllSync(JNIEnv* env, jobject obj, jstring search_string) { |
651 return GetFindHelper()->FindAllSync( | 669 return GetFindHelper()->FindAllSync( |
652 ConvertJavaStringToUTF16(env, search_string)); | 670 ConvertJavaStringToUTF16(env, search_string)); |
653 } | 671 } |
654 | 672 |
655 void AwContents::FindAllAsync(JNIEnv* env, jobject obj, jstring search_string) { | 673 void AwContents::FindAllAsync(JNIEnv* env, jobject obj, jstring search_string) { |
656 GetFindHelper()->FindAllAsync(ConvertJavaStringToUTF16(env, search_string)); | 674 GetFindHelper()->FindAllAsync(ConvertJavaStringToUTF16(env, search_string)); |
657 } | 675 } |
658 | 676 |
659 void AwContents::FindNext(JNIEnv* env, jobject obj, jboolean forward) { | 677 void AwContents::FindNext(JNIEnv* env, jobject obj, jboolean forward) { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 | 878 |
861 void AwContents::FocusFirstNode(JNIEnv* env, jobject obj) { | 879 void AwContents::FocusFirstNode(JNIEnv* env, jobject obj) { |
862 web_contents_->FocusThroughTabTraversal(false); | 880 web_contents_->FocusThroughTabTraversal(false); |
863 } | 881 } |
864 | 882 |
865 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) { | 883 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) { |
866 return reinterpret_cast<jint>(pending_contents_.release()); | 884 return reinterpret_cast<jint>(pending_contents_.release()); |
867 } | 885 } |
868 | 886 |
869 } // namespace android_webview | 887 } // namespace android_webview |
OLD | NEW |