| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/password_manager/password_form_android_utils.h" |
| 6 |
| 7 #include "base/android/jni_string.h" |
| 8 #include "jni/Credential_jni.h" |
| 9 |
| 10 base::android::ScopedJavaLocalRef<jobject> CreateNativeCredential( |
| 11 JNIEnv* env, |
| 12 const autofill::PasswordForm& password_form, |
| 13 int type) { |
| 14 return CreateNativeCredential(env, password_form, 0, type); |
| 15 } |
| 16 |
| 17 base::android::ScopedJavaLocalRef<jobject> CreateNativeCredential( |
| 18 JNIEnv* env, |
| 19 const autofill::PasswordForm& password_form, |
| 20 int position, |
| 21 int type) { |
| 22 using base::android::ConvertUTF16ToJavaString; |
| 23 using base::android::ConvertUTF8ToJavaString; |
| 24 return Java_Credential_createCredential( |
| 25 env, ConvertUTF16ToJavaString(env, password_form.username_value).obj(), |
| 26 ConvertUTF16ToJavaString(env, password_form.display_name).obj(), |
| 27 type, position); |
| 28 } |
| 29 |
| 30 base::android::ScopedJavaLocalRef<jobjectArray> CreateNativeCredentialArray( |
| 31 JNIEnv* env, |
| 32 size_t size) { |
| 33 return Java_Credential_createCredentialArray(env, static_cast<int>(size)); |
| 34 } |
| 35 |
| 36 bool RegisterCredential(JNIEnv* env) { |
| 37 return RegisterNativesImpl(env); |
| 38 } |
| OLD | NEW |