| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "components/navigation_interception/navigation_params_android.h" | 5 #include "components/navigation_interception/navigation_params_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "jni/NavigationParams_jni.h" | 8 #include "jni/NavigationParams_jni.h" |
| 9 | 9 |
| 10 using base::android::ConvertUTF8ToJavaString; | 10 using base::android::ConvertUTF8ToJavaString; |
| 11 | 11 |
| 12 namespace navigation_interception { | 12 namespace navigation_interception { |
| 13 | 13 |
| 14 base::android::ScopedJavaLocalRef<jobject> CreateJavaNavigationParams( | 14 base::android::ScopedJavaLocalRef<jobject> CreateJavaNavigationParams( |
| 15 JNIEnv* env, | 15 JNIEnv* env, |
| 16 const NavigationParams& params) { | 16 const NavigationParams& params) { |
| 17 ScopedJavaLocalRef<jstring> jstring_url = | 17 ScopedJavaLocalRef<jstring> jstring_url = |
| 18 ConvertUTF8ToJavaString(env, params.url().spec()); | 18 ConvertUTF8ToJavaString(env, params.url().spec()); |
| 19 | 19 |
| 20 return Java_NavigationParams_create(env, | 20 return Java_NavigationParams_create( |
| 21 jstring_url.obj(), | 21 env, jstring_url.obj(), params.is_post(), params.has_user_gesture(), |
| 22 params.is_post(), | 22 params.transition_type(), params.is_redirect(), |
| 23 params.has_user_gesture(), | 23 params.is_external_protocol()); |
| 24 params.transition_type(), | |
| 25 params.is_redirect()); | |
| 26 } | 24 } |
| 27 | 25 |
| 28 // Register native methods. | 26 // Register native methods. |
| 29 | 27 |
| 30 bool RegisterNavigationParams(JNIEnv* env) { | 28 bool RegisterNavigationParams(JNIEnv* env) { |
| 31 return RegisterNativesImpl(env); | 29 return RegisterNativesImpl(env); |
| 32 } | 30 } |
| 33 | 31 |
| 34 } // namespace navigation_interception | 32 } // namespace navigation_interception |
| OLD | NEW |