SCHEME_HTML,
SCHEME_BASIC,
SCHEME_DIGEST,
- SCHEME_OTHER
+ SCHEME_OTHER,
+ SCHEME_LAST = SCHEME_OTHER
} scheme;
// The "Realm" for the sign-on (scheme, host, port for SCHEME_HTML, and
// When parsing an HTML form, this is typically empty.
std::vector<base::string16> other_possible_usernames;
- // The name of the password input element, Optional (improves scoring).
+ // The name of the input element corresponding to the current password.
+ // Optional (improves scoring).
//
- // When parsing an HTML form, this must always be set.
+ // When parsing an HTML form, this will always be set, unless it is a sign-up
+ // form or a change password form that does not ask for the current password.
+ // In these two cases the |new_password_element| will always be set.
base::string16 password_element;
- // The password. Required.
+ // The current password. Must be non-empty for PasswordForm instances that are
+ // meant to be persisted to the password store.
//
// When parsing an HTML form, this is typically empty.
base::string16 password_value;
// True otherwise.
bool password_autocomplete_set;
- // If the form was a change password form, the name of the
- // 'old password' input element. Optional.
- base::string16 old_password_element;
+ // If the form was a sign-up or a change password form, the name of the input
+ // element corresponding to the new password. Optional, and not persisted.
+ base::string16 new_password_element;
- // The old password. Optional.
- base::string16 old_password_value;
+ // The new password. Optional, and not persisted.
+ base::string16 new_password_value;
// Whether or not this login was saved under an HTTPS session with a valid
// SSL cert. We will never match or autofill a PasswordForm where
// When parsing an HTML form, this is not used.
base::Time date_created;
+ // When the login was downloaded from the sync server. For local passwords is
+ // not used.
+ //
+ // When parsing an HTML form, this is not used.
+ base::Time date_synced;
+
// Tracks if the user opted to never remember passwords for this form. Default
// to false.
//
enum Type {
TYPE_MANUAL,
TYPE_GENERATED,
+ TYPE_LAST = TYPE_GENERATED
};
// The form type. Not used yet. Please see http://crbug.com/152422
// When parsing an HTML form, this is normally set.
FormData form_data;
+ // These following fields are set by a website using the Credential Manager
+ // API. They will be empty and remain unused for sites which do not use that
+ // API.
+ //
+ // User friendly name to show in the UI.
+ base::string16 display_name;
+
+ // The URL of the user's avatar to display in the UI.
+ GURL avatar_url;
+
+ // The URL of identity provider used for federated login.
+ GURL federation_url;
+
+ // If true, Chrome will sign the user in automatically using the credentials.
+ // This field isn't synced deliberately.
+ bool is_zero_click;
+
// Returns true if this match was found using public suffix matching.
bool IsPublicSuffixMatch() const;
// Map username to PasswordForm* for convenience. See password_form_manager.h.
typedef std::map<base::string16, PasswordForm*> PasswordFormMap;
+typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap;
+
// For testing.
std::ostream& operator<<(std::ostream& os,
const autofill::PasswordForm& form);