Chromium Code Reviews| 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..8779d670213dff962d664beb82b61c052657ed3f |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java |
| @@ -0,0 +1,58 @@ |
| +// 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 { |
|
newt (away)
2015/03/17 06:04:17
The convention is to name the C++ counterpart with
melandory
2015/03/17 13:05:33
Done: prefer changing c++ file name.
|
| + private final String mUsername; |
| + private final String mDisplayName; |
| + private final int mType; |
| + private final int mIndex; |
| + |
| + /** |
| + * @param username username which corresponds to the credential. |
|
newt (away)
2015/03/17 06:04:18
These parameters should be defined more precisely.
melandory
2015/03/17 13:05:33
Done.
|
| + * @param displayName user friendly name to show in the UI. It can be empty. |
| + * @param type type which should be either local or federated. |
|
newt (away)
2015/03/17 06:04:17
Since "type" is an int, you need to explain what i
melandory
2015/03/17 13:05:33
Done.
|
| + * @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]; |
| + } |
| +} |