OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 enum class Layout { | 77 enum class Layout { |
78 // Forms which either do not need to be classified, or cannot be classified | 78 // Forms which either do not need to be classified, or cannot be classified |
79 // meaningfully. | 79 // meaningfully. |
80 LAYOUT_OTHER, | 80 LAYOUT_OTHER, |
81 // Login and signup forms combined in one <form>, to distinguish them from, | 81 // Login and signup forms combined in one <form>, to distinguish them from, |
82 // e.g., change-password forms. | 82 // e.g., change-password forms. |
83 LAYOUT_LOGIN_AND_SIGNUP, | 83 LAYOUT_LOGIN_AND_SIGNUP, |
84 LAYOUT_LAST = LAYOUT_LOGIN_AND_SIGNUP | 84 LAYOUT_LAST = LAYOUT_LOGIN_AND_SIGNUP |
85 }; | 85 }; |
86 | 86 |
| 87 // Events observed by the Password Manager that indicate either that a form is |
| 88 // potentially being submitted, or that a form has already been successfully |
| 89 // submitted. Recorded into a UMA histogram, so order of enumerators should |
| 90 // not be changed. |
| 91 enum class SubmissionIndicatorEvent { |
| 92 NONE, |
| 93 HTML_FORM_SUBMISSION, |
| 94 SAME_DOCUMENT_NAVIGATION, |
| 95 XHR_SUCCEEDED, |
| 96 FRAME_DETACHED, |
| 97 MANUAL_SAVE, |
| 98 SUBMISSION_INDICATOR_EVENT_COUNT |
| 99 }; |
| 100 |
87 // The "Realm" for the sign-on. This is scheme, host, port for SCHEME_HTML. | 101 // The "Realm" for the sign-on. This is scheme, host, port for SCHEME_HTML. |
88 // Dialog based forms also contain the HTTP realm. Android based forms will | 102 // Dialog based forms also contain the HTTP realm. Android based forms will |
89 // contain a string of the form "android://<hash of cert>@<package name>" | 103 // contain a string of the form "android://<hash of cert>@<package name>" |
90 // | 104 // |
91 // The signon_realm is effectively the primary key used for retrieving | 105 // The signon_realm is effectively the primary key used for retrieving |
92 // data from the database, so it must not be empty. | 106 // data from the database, so it must not be empty. |
93 std::string signon_realm; | 107 std::string signon_realm; |
94 | 108 |
95 // An origin URL consists of the scheme, host, port and path; the rest is | 109 // An origin URL consists of the scheme, host, port and path; the rest is |
96 // stripped. This is the primary data used by the PasswordManager to decide | 110 // stripped. This is the primary data used by the PasswordManager to decide |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // If true, this match was found using public suffix matching. | 285 // If true, this match was found using public suffix matching. |
272 bool is_public_suffix_match; | 286 bool is_public_suffix_match; |
273 | 287 |
274 // If true, this is a credential saved through an Android application, and | 288 // If true, this is a credential saved through an Android application, and |
275 // found using affiliation-based match. | 289 // found using affiliation-based match. |
276 bool is_affiliation_based_match; | 290 bool is_affiliation_based_match; |
277 | 291 |
278 // If true, this form looks like SignUp form according to local heuristics. | 292 // If true, this form looks like SignUp form according to local heuristics. |
279 bool does_look_like_signup_form; | 293 bool does_look_like_signup_form; |
280 | 294 |
| 295 // The type of the event that was taken as an indication that this form is |
| 296 // being or has already been submitted. This field is not persisted and filled |
| 297 // out only for submitted forms. |
| 298 SubmissionIndicatorEvent submission_event; |
| 299 |
281 // Return true if we consider this form to be a change password form. | 300 // Return true if we consider this form to be a change password form. |
282 // We use only client heuristics, so it could include signup forms. | 301 // We use only client heuristics, so it could include signup forms. |
283 bool IsPossibleChangePasswordForm() const; | 302 bool IsPossibleChangePasswordForm() const; |
284 | 303 |
285 // Return true if we consider this form to be a change password form | 304 // Return true if we consider this form to be a change password form |
286 // without username field. We use only client heuristics, so it could | 305 // without username field. We use only client heuristics, so it could |
287 // include signup forms. | 306 // include signup forms. |
288 bool IsPossibleChangePasswordFormWithoutUsername() const; | 307 bool IsPossibleChangePasswordFormWithoutUsername() const; |
289 | 308 |
290 // Equality operators for testing. | 309 // Equality operators for testing. |
(...skipping 17 matching lines...) Expand all Loading... |
308 }; | 327 }; |
309 | 328 |
310 // Converts a vector of possible usernames to string. | 329 // Converts a vector of possible usernames to string. |
311 base::string16 OtherPossibleUsernamesToString( | 330 base::string16 OtherPossibleUsernamesToString( |
312 const PossibleUsernamesVector& possible_usernames); | 331 const PossibleUsernamesVector& possible_usernames); |
313 | 332 |
314 // For testing. | 333 // For testing. |
315 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 334 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
316 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); | 335 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); |
317 std::ostream& operator<<(std::ostream& os, PasswordForm* form); | 336 std::ostream& operator<<(std::ostream& os, PasswordForm* form); |
| 337 std::ostream& operator<<( |
| 338 std::ostream& os, |
| 339 PasswordForm::SubmissionIndicatorEvent submission_event); |
318 | 340 |
319 } // namespace autofill | 341 } // namespace autofill |
320 | 342 |
321 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 343 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |