Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2156)

Unified Diff: chrome/browser/password_manager/credential_android.cc

Issue 925593006: Pass all info to account chooser infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java_cpp_enum
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/credential_android.cc
diff --git a/chrome/browser/password_manager/credential_android.cc b/chrome/browser/password_manager/credential_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bc4ce1b094b3e21e04ba710225223b39ca003ab9
--- /dev/null
+++ b/chrome/browser/password_manager/credential_android.cc
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/password_manager/credential_android.h"
+
+#include "base/android/jni_string.h"
+#include "jni/Credential_jni.h"
+
+base::android::ScopedJavaLocalRef<jobject> CreateNativeCredential(
+ JNIEnv* env,
+ const autofill::PasswordForm& password_form,
+ int position,
+ int type) {
+ using base::android::ConvertUTF16ToJavaString;
+ using base::android::ConvertUTF8ToJavaString;
+ return Java_Credential_createCredential(
+ env, ConvertUTF16ToJavaString(env, password_form.username_value).obj(),
+ ConvertUTF16ToJavaString(env, password_form.display_name).obj(), type,
+ position);
+}
+
+base::android::ScopedJavaLocalRef<jobjectArray> CreateNativeCredentialArray(
+ JNIEnv* env,
+ size_t size) {
+ return Java_Credential_createCredentialArray(env, static_cast<int>(size));
+}
+
+bool RegisterCredential(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
« no previous file with comments | « chrome/browser/password_manager/credential_android.h ('k') | chrome/browser/ui/android/infobars/account_chooser_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698