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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java

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/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java
new file mode 100644
index 0000000000000000000000000000000000000000..d694f0ce9e1917386d64def0657dabdd13eee7af
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java
@@ -0,0 +1,61 @@
+// 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.
+
+package org.chromium.chrome.browser.password_manager;
+
+import org.chromium.base.CalledByNative;
+
+/**
+ * Credential type which is used to represent credential which will be shown in account chooser
+ * infobar.
+ * */
+public class Credential {
+ private final String mUsername;
+ private final String mDisplayName;
+ private final int mType;
+ private final int mIndex;
+
+ /**
+ * @param username username which is used to authenticate user.
+ * The value is PasswordForm::username_value.
+ * @param displayName user friendly name to show in the UI. It can be empty.
+ * The value is PasswordForm::display_name.
+ * @param type type which should be either local or federated. The value corresponds to a
+ * C++ enum CredentialType.
+ * @param index position in array of credentials.
+ */
+ public Credential(String username, String displayName, int type, int index) {
+ mUsername = username;
+ mDisplayName = displayName;
+ mType = type;
+ mIndex = index;
+ }
+
+ public String getUsername() {
+ return mUsername;
+ }
+
+ public String getDisplayName() {
+ return mDisplayName;
+ }
+
+ public int getIndex() {
+ return mIndex;
+ }
+
+ public int getType() {
+ return mType;
+ }
+
+ @CalledByNative
+ private static Credential createCredential(
+ String username, String displayName, int type, int index) {
+ return new Credential(username, displayName, type, index);
+ }
+
+ @CalledByNative
+ private static Credential[] createCredentialArray(int size) {
+ return new Credential[size];
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698