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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // m.example.com, foo.login.example.com and www.example.com would all resolve | 66 // m.example.com, foo.login.example.com and www.example.com would all resolve |
67 // to example.com since .com is the public suffix. | 67 // to example.com since .com is the public suffix. |
68 // 3) The scheme is the same. | 68 // 3) The scheme is the same. |
69 // 4) The port is the same. | 69 // 4) The port is the same. |
70 // For example, if there exists a stored password for http://www.example.com | 70 // For example, if there exists a stored password for http://www.example.com |
71 // (where .com is the public suffix) and the observed form is | 71 // (where .com is the public suffix) and the observed form is |
72 // http://m.example.com, |original_signon_realm| must be set to | 72 // http://m.example.com, |original_signon_realm| must be set to |
73 // http://www.example.com. | 73 // http://www.example.com. |
74 std::string original_signon_realm; | 74 std::string original_signon_realm; |
75 | 75 |
76 // The URL (minus query parameters) containing the form. This is the primary | 76 // An origin URL consists of the scheme, host, port and path; the rest is |
77 // data used by the PasswordManager to decide (in longest matching prefix | 77 // stripped. This is the primary data used by the PasswordManager to decide |
78 // fashion) whether or not a given PasswordForm result from the database is a | 78 // (in longest matching prefix fashion) whether or not a given PasswordForm |
79 // good fit for a particular form on a page, so it must not be empty. | 79 // result from the database is a good fit for a particular form on a page, so |
| 80 // it must not be empty. |
80 GURL origin; | 81 GURL origin; |
81 | 82 |
82 // The action target of the form. This is the primary data used by the | 83 // The action target of the form; like |origin| URL consists of the scheme, |
83 // PasswordManager for form autofill; that is, the action of the saved | 84 // host, port and path; the rest is stripped. This is the primary data used by |
| 85 // the PasswordManager for form autofill; that is, the action of the saved |
84 // credentials must match the action of the form on the page to be autofilled. | 86 // credentials must match the action of the form on the page to be autofilled. |
85 // If this is empty / not available, it will result in a "restricted" | 87 // If this is empty / not available, it will result in a "restricted" IE-like |
86 // IE-like autofill policy, where we wait for the user to type in his | 88 // autofill policy, where we wait for the user to type in his username before |
87 // username before autofilling the password. In these cases, after successful | 89 // autofilling the password. In these cases, after successful login the action |
88 // login the action URL will automatically be assigned by the | 90 // URL will automatically be assigned by the PasswordManager. |
89 // PasswordManager. | |
90 // | 91 // |
91 // When parsing an HTML form, this must always be set. | 92 // When parsing an HTML form, this must always be set. |
92 GURL action; | 93 GURL action; |
93 | 94 |
94 // The name of the submit button used. Optional; only used in scoring | 95 // The name of the submit button used. Optional; only used in scoring |
95 // of PasswordForm results from the database to make matches as tight as | 96 // of PasswordForm results from the database to make matches as tight as |
96 // possible. | 97 // possible. |
97 // | 98 // |
98 // When parsing an HTML form, this must always be set. | 99 // When parsing an HTML form, this must always be set. |
99 base::string16 submit_element; | 100 base::string16 submit_element; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 234 |
234 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; | 235 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; |
235 | 236 |
236 // For testing. | 237 // For testing. |
237 std::ostream& operator<<(std::ostream& os, | 238 std::ostream& operator<<(std::ostream& os, |
238 const autofill::PasswordForm& form); | 239 const autofill::PasswordForm& form); |
239 | 240 |
240 } // namespace autofill | 241 } // namespace autofill |
241 | 242 |
242 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 243 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |