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.
5 #include "chrome/browser/password_manager/credential_android.h"
7 #include "base/android/jni_string.h"
8 #include "jni/Credential_jni.h"
10 base::android::ScopedJavaLocalRef
<jobject
> CreateNativeCredential(
12 const autofill::PasswordForm
& password_form
,
15 using base::android::ConvertUTF16ToJavaString
;
16 using base::android::ConvertUTF8ToJavaString
;
17 return Java_Credential_createCredential(
18 env
, ConvertUTF16ToJavaString(env
, password_form
.username_value
).obj(),
19 ConvertUTF16ToJavaString(env
, password_form
.display_name
).obj(), type
,
23 base::android::ScopedJavaLocalRef
<jobjectArray
> CreateNativeCredentialArray(
26 return Java_Credential_createCredentialArray(env
, static_cast<int>(size
));
29 bool RegisterCredential(JNIEnv
* env
) {
30 return RegisterNativesImpl(env
);