| 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 jstring url, | 900 jstring url, |
| 901 jint load_url_type, | 901 jint load_url_type, |
| 902 jint transition_type, | 902 jint transition_type, |
| 903 jstring j_referrer_url, | 903 jstring j_referrer_url, |
| 904 jint referrer_policy, | 904 jint referrer_policy, |
| 905 jint ua_override_option, | 905 jint ua_override_option, |
| 906 jstring extra_headers, | 906 jstring extra_headers, |
| 907 jbyteArray post_data, | 907 jbyteArray post_data, |
| 908 jstring base_url_for_data_url, | 908 jstring base_url_for_data_url, |
| 909 jstring virtual_url_for_data_url, | 909 jstring virtual_url_for_data_url, |
| 910 jboolean can_load_local_resources) { | 910 jboolean can_load_local_resources, |
| 911 jboolean is_renderer_initiated) { |
| 911 DCHECK(url); | 912 DCHECK(url); |
| 912 NavigationController::LoadURLParams params( | 913 NavigationController::LoadURLParams params( |
| 913 GURL(ConvertJavaStringToUTF8(env, url))); | 914 GURL(ConvertJavaStringToUTF8(env, url))); |
| 914 | 915 |
| 915 params.load_type = static_cast<NavigationController::LoadURLType>( | 916 params.load_type = static_cast<NavigationController::LoadURLType>( |
| 916 load_url_type); | 917 load_url_type); |
| 917 params.transition_type = PageTransitionFromInt(transition_type); | 918 params.transition_type = PageTransitionFromInt(transition_type); |
| 918 params.override_user_agent = | 919 params.override_user_agent = |
| 919 static_cast<NavigationController::UserAgentOverrideOption>( | 920 static_cast<NavigationController::UserAgentOverrideOption>( |
| 920 ua_override_option); | 921 ua_override_option); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 939 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); | 940 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); |
| 940 } | 941 } |
| 941 | 942 |
| 942 params.can_load_local_resources = can_load_local_resources; | 943 params.can_load_local_resources = can_load_local_resources; |
| 943 if (j_referrer_url) { | 944 if (j_referrer_url) { |
| 944 params.referrer = content::Referrer( | 945 params.referrer = content::Referrer( |
| 945 GURL(ConvertJavaStringToUTF8(env, j_referrer_url)), | 946 GURL(ConvertJavaStringToUTF8(env, j_referrer_url)), |
| 946 static_cast<blink::WebReferrerPolicy>(referrer_policy)); | 947 static_cast<blink::WebReferrerPolicy>(referrer_policy)); |
| 947 } | 948 } |
| 948 | 949 |
| 950 params.is_renderer_initiated = is_renderer_initiated; |
| 951 |
| 949 LoadUrl(params); | 952 LoadUrl(params); |
| 950 } | 953 } |
| 951 | 954 |
| 952 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( | 955 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( |
| 953 JNIEnv* env, jobject) const { | 956 JNIEnv* env, jobject) const { |
| 954 return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec()); | 957 return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec()); |
| 955 } | 958 } |
| 956 | 959 |
| 957 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { | 960 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { |
| 958 return GetWebContents()->GetBrowserContext()->IsOffTheRecord(); | 961 return GetWebContents()->GetBrowserContext()->IsOffTheRecord(); |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1682 reinterpret_cast<ui::ViewAndroid*>(view_android), |
| 1680 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1683 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
| 1681 return reinterpret_cast<intptr_t>(view); | 1684 return reinterpret_cast<intptr_t>(view); |
| 1682 } | 1685 } |
| 1683 | 1686 |
| 1684 bool RegisterContentViewCore(JNIEnv* env) { | 1687 bool RegisterContentViewCore(JNIEnv* env) { |
| 1685 return RegisterNativesImpl(env); | 1688 return RegisterNativesImpl(env); |
| 1686 } | 1689 } |
| 1687 | 1690 |
| 1688 } // namespace content | 1691 } // namespace content |
| OLD | NEW |