| 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_main_parts.h" | 9 #include "android_webview/browser/aw_browser_main_parts.h" |
| 10 #include "android_webview/browser/net_disk_cache_remover.h" | 10 #include "android_webview/browser/net_disk_cache_remover.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 jboolean private_browsing) { | 640 jboolean private_browsing) { |
| 641 AwContents* tab = new AwContents(env, obj, web_contents_delegate, | 641 AwContents* tab = new AwContents(env, obj, web_contents_delegate, |
| 642 private_browsing); | 642 private_browsing); |
| 643 return reinterpret_cast<jint>(tab); | 643 return reinterpret_cast<jint>(tab); |
| 644 } | 644 } |
| 645 | 645 |
| 646 bool RegisterAwContents(JNIEnv* env) { | 646 bool RegisterAwContents(JNIEnv* env) { |
| 647 return RegisterNativesImpl(env) >= 0; | 647 return RegisterNativesImpl(env) >= 0; |
| 648 } | 648 } |
| 649 | 649 |
| 650 void AwContents::GeolocationShowPrompt(int render_process_id, |
| 651 int render_view_id, |
| 652 int bridge_id, |
| 653 const GURL& requesting_frame) { |
| 654 JNIEnv* env = AttachCurrentThread(); |
| 655 ScopedJavaLocalRef<jstring> j_requesting_frame( |
| 656 ConvertUTF8ToJavaString(env, requesting_frame.spec())); |
| 657 Java_AwContents_onGeolocationPermissionsShowPrompt(env, |
| 658 java_ref_.get(env).obj(), render_process_id, render_view_id, bridge_id, |
| 659 j_requesting_frame.obj()); |
| 660 } |
| 661 |
| 662 void AwContents::GeolocationHidePrompt() { |
| 663 // TODO(kristianm): Implement this |
| 664 } |
| 665 |
| 650 jint AwContents::FindAllSync(JNIEnv* env, jobject obj, jstring search_string) { | 666 jint AwContents::FindAllSync(JNIEnv* env, jobject obj, jstring search_string) { |
| 651 return GetFindHelper()->FindAllSync( | 667 return GetFindHelper()->FindAllSync( |
| 652 ConvertJavaStringToUTF16(env, search_string)); | 668 ConvertJavaStringToUTF16(env, search_string)); |
| 653 } | 669 } |
| 654 | 670 |
| 655 void AwContents::FindAllAsync(JNIEnv* env, jobject obj, jstring search_string) { | 671 void AwContents::FindAllAsync(JNIEnv* env, jobject obj, jstring search_string) { |
| 656 GetFindHelper()->FindAllAsync(ConvertJavaStringToUTF16(env, search_string)); | 672 GetFindHelper()->FindAllAsync(ConvertJavaStringToUTF16(env, search_string)); |
| 657 } | 673 } |
| 658 | 674 |
| 659 void AwContents::FindNext(JNIEnv* env, jobject obj, jboolean forward) { | 675 void AwContents::FindNext(JNIEnv* env, jobject obj, jboolean forward) { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 | 876 |
| 861 void AwContents::FocusFirstNode(JNIEnv* env, jobject obj) { | 877 void AwContents::FocusFirstNode(JNIEnv* env, jobject obj) { |
| 862 web_contents_->FocusThroughTabTraversal(false); | 878 web_contents_->FocusThroughTabTraversal(false); |
| 863 } | 879 } |
| 864 | 880 |
| 865 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) { | 881 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) { |
| 866 return reinterpret_cast<jint>(pending_contents_.release()); | 882 return reinterpret_cast<jint>(pending_contents_.release()); |
| 867 } | 883 } |
| 868 | 884 |
| 869 } // namespace android_webview | 885 } // namespace android_webview |
| OLD | NEW |