Fire an error if a pref used in the UI is missing once all prefs are fetched.
[chromium-blink-merge.git] / chrome / browser / password_manager / credential_android.cc
blobbc4ce1b094b3e21e04ba710225223b39ca003ab9
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(
11 JNIEnv* env,
12 const autofill::PasswordForm& password_form,
13 int position,
14 int type) {
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,
20 position);
23 base::android::ScopedJavaLocalRef<jobjectArray> CreateNativeCredentialArray(
24 JNIEnv* env,
25 size_t size) {
26 return Java_Credential_createCredentialArray(env, static_cast<int>(size));
29 bool RegisterCredential(JNIEnv* env) {
30 return RegisterNativesImpl(env);