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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 }; | 77 }; |
78 | 78 |
79 // The "Realm" for the sign-on. This is scheme, host, port for SCHEME_HTML. | 79 // The "Realm" for the sign-on. This is scheme, host, port for SCHEME_HTML. |
80 // Dialog based forms also contain the HTTP realm. Android based forms will | 80 // Dialog based forms also contain the HTTP realm. Android based forms will |
81 // contain a string of the form "android://<hash of cert>@<package name>" | 81 // contain a string of the form "android://<hash of cert>@<package name>" |
82 // | 82 // |
83 // The signon_realm is effectively the primary key used for retrieving | 83 // The signon_realm is effectively the primary key used for retrieving |
84 // data from the database, so it must not be empty. | 84 // data from the database, so it must not be empty. |
85 std::string signon_realm; | 85 std::string signon_realm; |
86 | 86 |
87 // The original "Realm" for the sign-on (scheme, host, port for SCHEME_HTML, | |
88 // and contains the HTTP realm for dialog-based forms). This realm is only set | |
89 // when two PasswordForms are matched when trying to find a login/pass pair | |
90 // for a site. It is only set to a non-empty value during a match of the | |
91 // original stored login/pass and the current observed form if all these | |
92 // statements are true: | |
93 // 1) The full signon_realm is not the same. | |
94 // 2) The registry controlled domain is the same. For example; example.com, | |
95 // m.example.com, foo.login.example.com and www.example.com would all resolve | |
96 // to example.com since .com is the public suffix. | |
97 // 3) The scheme is the same. | |
98 // 4) The port is the same. | |
99 // For example, if there exists a stored password for http://www.example.com | |
100 // (where .com is the public suffix) and the observed form is | |
101 // http://m.example.com, |original_signon_realm| must be set to | |
102 // http://www.example.com. | |
103 std::string original_signon_realm; | |
104 | |
105 // An origin URL consists of the scheme, host, port and path; the rest is | 87 // An origin URL consists of the scheme, host, port and path; the rest is |
106 // stripped. This is the primary data used by the PasswordManager to decide | 88 // stripped. This is the primary data used by the PasswordManager to decide |
107 // (in longest matching prefix fashion) whether or not a given PasswordForm | 89 // (in longest matching prefix fashion) whether or not a given PasswordForm |
108 // result from the database is a good fit for a particular form on a page. | 90 // result from the database is a good fit for a particular form on a page. |
109 // This should not be empty except for Android based credentials. | 91 // This should not be empty except for Android based credentials. |
110 // TODO(melandory): origin should be renamed in order to be consistent with | 92 // TODO(melandory): origin should be renamed in order to be consistent with |
111 // GURL definition of origin. | 93 // GURL definition of origin. |
112 GURL origin; | 94 GURL origin; |
113 | 95 |
114 // The action target of the form; like |origin| URL consists of the scheme, | 96 // The action target of the form; like |origin| URL consists of the scheme, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 | 254 |
273 // The layout as determined during parsing. Default value is LAYOUT_OTHER. | 255 // The layout as determined during parsing. Default value is LAYOUT_OTHER. |
274 Layout layout; | 256 Layout layout; |
275 | 257 |
276 // If true, this form was parsed using Autofill predictions. | 258 // If true, this form was parsed using Autofill predictions. |
277 bool was_parsed_using_autofill_predictions; | 259 bool was_parsed_using_autofill_predictions; |
278 | 260 |
279 // TODO(vabr): Remove |is_alive| once http://crbug.com/486931 is fixed. | 261 // TODO(vabr): Remove |is_alive| once http://crbug.com/486931 is fixed. |
280 bool is_alive; // Set on construction, reset on destruction. | 262 bool is_alive; // Set on construction, reset on destruction. |
281 | 263 |
282 // Returns true if this match was found using public suffix matching. | 264 // true if this match was found using public suffix matching. |
engedy
2015/09/29 16:20:45
comment nit: If true, this match ...
dvadym
2015/09/29 18:29:36
Done.
| |
283 bool IsPublicSuffixMatch() const; | 265 bool is_public_suffix_match; |
284 | 266 |
285 // Return true if we consider this form to be a change password form. | 267 // Return true if we consider this form to be a change password form. |
286 // We use only client heuristics, so it could include signup forms. | 268 // We use only client heuristics, so it could include signup forms. |
287 bool IsPossibleChangePasswordForm() const; | 269 bool IsPossibleChangePasswordForm() const; |
288 | 270 |
289 // Return true if we consider this form to be a change password form | 271 // Return true if we consider this form to be a change password form |
290 // without username field. We use only client heuristics, so it could | 272 // without username field. We use only client heuristics, so it could |
291 // include signup forms. | 273 // include signup forms. |
292 bool IsPossibleChangePasswordFormWithoutUsername() const; | 274 bool IsPossibleChangePasswordFormWithoutUsername() const; |
293 | 275 |
(...skipping 23 matching lines...) Expand all Loading... | |
317 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; | 299 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; |
318 | 300 |
319 // For testing. | 301 // For testing. |
320 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 302 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
321 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); | 303 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); |
322 std::ostream& operator<<(std::ostream& os, PasswordForm* form); | 304 std::ostream& operator<<(std::ostream& os, PasswordForm* form); |
323 | 305 |
324 } // namespace autofill | 306 } // namespace autofill |
325 | 307 |
326 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 308 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |