OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 jstring url, | 840 jstring url, |
841 jint load_url_type, | 841 jint load_url_type, |
842 jint transition_type, | 842 jint transition_type, |
843 jstring j_referrer_url, | 843 jstring j_referrer_url, |
844 jint referrer_policy, | 844 jint referrer_policy, |
845 jint ua_override_option, | 845 jint ua_override_option, |
846 jstring extra_headers, | 846 jstring extra_headers, |
847 jbyteArray post_data, | 847 jbyteArray post_data, |
848 jstring base_url_for_data_url, | 848 jstring base_url_for_data_url, |
849 jstring virtual_url_for_data_url, | 849 jstring virtual_url_for_data_url, |
850 jboolean can_load_local_resources) { | 850 jboolean can_load_local_resources, |
| 851 jboolean is_renderer_initiated) { |
851 DCHECK(url); | 852 DCHECK(url); |
852 NavigationController::LoadURLParams params( | 853 NavigationController::LoadURLParams params( |
853 GURL(ConvertJavaStringToUTF8(env, url))); | 854 GURL(ConvertJavaStringToUTF8(env, url))); |
854 | 855 |
855 params.load_type = static_cast<NavigationController::LoadURLType>( | 856 params.load_type = static_cast<NavigationController::LoadURLType>( |
856 load_url_type); | 857 load_url_type); |
857 params.transition_type = PageTransitionFromInt(transition_type); | 858 params.transition_type = PageTransitionFromInt(transition_type); |
858 params.override_user_agent = | 859 params.override_user_agent = |
859 static_cast<NavigationController::UserAgentOverrideOption>( | 860 static_cast<NavigationController::UserAgentOverrideOption>( |
860 ua_override_option); | 861 ua_override_option); |
(...skipping 18 matching lines...) Expand all Loading... |
879 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); | 880 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); |
880 } | 881 } |
881 | 882 |
882 params.can_load_local_resources = can_load_local_resources; | 883 params.can_load_local_resources = can_load_local_resources; |
883 if (j_referrer_url) { | 884 if (j_referrer_url) { |
884 params.referrer = content::Referrer( | 885 params.referrer = content::Referrer( |
885 GURL(ConvertJavaStringToUTF8(env, j_referrer_url)), | 886 GURL(ConvertJavaStringToUTF8(env, j_referrer_url)), |
886 static_cast<blink::WebReferrerPolicy>(referrer_policy)); | 887 static_cast<blink::WebReferrerPolicy>(referrer_policy)); |
887 } | 888 } |
888 | 889 |
| 890 params.is_renderer_initiated = is_renderer_initiated; |
| 891 |
889 LoadUrl(params); | 892 LoadUrl(params); |
890 } | 893 } |
891 | 894 |
892 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( | 895 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( |
893 JNIEnv* env, jobject) const { | 896 JNIEnv* env, jobject) const { |
894 return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec()); | 897 return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec()); |
895 } | 898 } |
896 | 899 |
897 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { | 900 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { |
898 return GetWebContents()->GetBrowserContext()->IsOffTheRecord(); | 901 return GetWebContents()->GetBrowserContext()->IsOffTheRecord(); |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1618 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1616 retained_objects_set); | 1619 retained_objects_set); |
1617 return reinterpret_cast<intptr_t>(view); | 1620 return reinterpret_cast<intptr_t>(view); |
1618 } | 1621 } |
1619 | 1622 |
1620 bool RegisterContentViewCore(JNIEnv* env) { | 1623 bool RegisterContentViewCore(JNIEnv* env) { |
1621 return RegisterNativesImpl(env); | 1624 return RegisterNativesImpl(env); |
1622 } | 1625 } |
1623 | 1626 |
1624 } // namespace content | 1627 } // namespace content |
OLD | NEW |