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 that Password Manager uses as triggers for checking a success of a | |
engedy
2017/05/10 13:07:43
Phrasing nit:
// Events observed by the Password
dvadym
2017/05/10 14:09:26
Thanks, done
| |
88 // password form submission. | |
89 enum class SubmissionIndicatorEvent { | |
90 NONE, | |
91 HTML_FORM_SUBMISSION, | |
92 INPAGE_NAVIGATION, | |
engedy
2017/05/10 13:07:42
nit: SAME_DOCUMENT_NAVIGATION for consistency
dvadym
2017/05/10 14:09:26
Done.
| |
93 XHR_SUCCEEDED, | |
94 FRAME_DETACHED, | |
95 BY_CONTEXT_MENU_CLICK, | |
engedy
2017/05/10 13:07:43
nit: This sounds like an implementation detail. Ha
dvadym
2017/05/10 14:09:26
Done.
| |
96 SUBMISSION_EVENT_COUNT | |
engedy
2017/05/10 13:07:42
nit: SUBMISSION_INDICATOR_EVENT_COUNT
dvadym
2017/05/10 14:09:26
Done.
| |
97 }; | |
98 | |
87 // The "Realm" for the sign-on. This is scheme, host, port for SCHEME_HTML. | 99 // 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 | 100 // 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>" | 101 // contain a string of the form "android://<hash of cert>@<package name>" |
90 // | 102 // |
91 // The signon_realm is effectively the primary key used for retrieving | 103 // The signon_realm is effectively the primary key used for retrieving |
92 // data from the database, so it must not be empty. | 104 // data from the database, so it must not be empty. |
93 std::string signon_realm; | 105 std::string signon_realm; |
94 | 106 |
95 // An origin URL consists of the scheme, host, port and path; the rest is | 107 // 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 | 108 // 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. | 283 // If true, this match was found using public suffix matching. |
272 bool is_public_suffix_match; | 284 bool is_public_suffix_match; |
273 | 285 |
274 // If true, this is a credential saved through an Android application, and | 286 // If true, this is a credential saved through an Android application, and |
275 // found using affiliation-based match. | 287 // found using affiliation-based match. |
276 bool is_affiliation_based_match; | 288 bool is_affiliation_based_match; |
277 | 289 |
278 // If true, this form looks like SignUp form according to local heuristics. | 290 // If true, this form looks like SignUp form according to local heuristics. |
279 bool does_look_like_signup_form; | 291 bool does_look_like_signup_form; |
280 | 292 |
293 // Type of event which was used for this form submission. | |
engedy
2017/05/10 13:07:42
Phrasing nit:
// The type of the event that was
dvadym
2017/05/10 14:09:26
Thanks, done
| |
294 SubmissionIndicatorEvent submission_event; | |
295 | |
281 // Return true if we consider this form to be a change password form. | 296 // 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. | 297 // We use only client heuristics, so it could include signup forms. |
283 bool IsPossibleChangePasswordForm() const; | 298 bool IsPossibleChangePasswordForm() const; |
284 | 299 |
285 // 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 |
286 // without username field. We use only client heuristics, so it could | 301 // without username field. We use only client heuristics, so it could |
287 // include signup forms. | 302 // include signup forms. |
288 bool IsPossibleChangePasswordFormWithoutUsername() const; | 303 bool IsPossibleChangePasswordFormWithoutUsername() const; |
289 | 304 |
290 // Equality operators for testing. | 305 // Equality operators for testing. |
(...skipping 17 matching lines...) Expand all Loading... | |
308 }; | 323 }; |
309 | 324 |
310 // Converts a vector of possible usernames to string. | 325 // Converts a vector of possible usernames to string. |
311 base::string16 OtherPossibleUsernamesToString( | 326 base::string16 OtherPossibleUsernamesToString( |
312 const PossibleUsernamesVector& possible_usernames); | 327 const PossibleUsernamesVector& possible_usernames); |
313 | 328 |
314 // For testing. | 329 // For testing. |
315 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 330 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
316 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); | 331 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); |
317 std::ostream& operator<<(std::ostream& os, PasswordForm* form); | 332 std::ostream& operator<<(std::ostream& os, PasswordForm* form); |
333 std::ostream& operator<<( | |
334 std::ostream& os, | |
335 PasswordForm::SubmissionIndicatorEvent submission_event); | |
318 | 336 |
319 } // namespace autofill | 337 } // namespace autofill |
320 | 338 |
321 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 339 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |