OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_PUBLIC_COMMON_PASSWORD_FORM_H__ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
6 #define CONTENT_PUBLIC_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> |
11 | 11 |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "content/common/content_export.h" | |
14 #include "url/gurl.h" | 13 #include "url/gurl.h" |
15 | 14 |
16 namespace content { | 15 namespace autofill { |
17 | 16 |
18 // The PasswordForm struct encapsulates information about a login form, | 17 // The PasswordForm struct encapsulates information about a login form, |
19 // which can be an HTML form or a dialog with username/password text fields. | 18 // which can be an HTML form or a dialog with username/password text fields. |
20 // | 19 // |
21 // The Web Data database stores saved username/passwords and associated form | 20 // The Web Data database stores saved username/passwords and associated form |
22 // metdata using a PasswordForm struct, typically one that was created from | 21 // metdata using a PasswordForm struct, typically one that was created from |
23 // a parsed HTMLFormElement or LoginDialog, but the saved entries could have | 22 // a parsed HTMLFormElement or LoginDialog, but the saved entries could have |
24 // also been created by imported data from another browser. | 23 // also been created by imported data from another browser. |
25 // | 24 // |
26 // The PasswordManager implements a fuzzy-matching algorithm to compare saved | 25 // The PasswordManager implements a fuzzy-matching algorithm to compare saved |
27 // PasswordForm entries against PasswordForms that were created from a parsed | 26 // PasswordForm entries against PasswordForms that were created from a parsed |
28 // HTML or dialog form. As one might expect, the more data contained in one | 27 // HTML or dialog form. As one might expect, the more data contained in one |
29 // of the saved PasswordForms, the better the job the PasswordManager can do | 28 // of the saved PasswordForms, the better the job the PasswordManager can do |
30 // in matching it against the actual form it was saved on, and autofill | 29 // in matching it against the actual form it was saved on, and autofill |
31 // accurately. But it is not always possible, especially when importing from | 30 // accurately. But it is not always possible, especially when importing from |
32 // other browsers with different data models, to copy over all the information | 31 // other browsers with different data models, to copy over all the information |
33 // about a particular "saved password entry" to our PasswordForm | 32 // about a particular "saved password entry" to our PasswordForm |
34 // representation. | 33 // representation. |
35 // | 34 // |
36 // The field descriptions in the struct specification below are intended to | 35 // The field descriptions in the struct specification below are intended to |
37 // describe which fields are not strictly required when adding a saved password | 36 // describe which fields are not strictly required when adding a saved password |
38 // entry to the database and how they can affect the matching process. | 37 // entry to the database and how they can affect the matching process. |
39 | 38 |
40 struct CONTENT_EXPORT PasswordForm { | 39 struct PasswordForm { |
41 // Enum to differentiate between HTML form based authentication, and dialogs | 40 // Enum to differentiate between HTML form based authentication, and dialogs |
42 // using basic or digest schemes. Default is SCHEME_HTML. Only PasswordForms | 41 // using basic or digest schemes. Default is SCHEME_HTML. Only PasswordForms |
43 // of the same Scheme will be matched/autofilled against each other. | 42 // of the same Scheme will be matched/autofilled against each other. |
44 enum Scheme { | 43 enum Scheme { |
45 SCHEME_HTML, | 44 SCHEME_HTML, |
46 SCHEME_BASIC, | 45 SCHEME_BASIC, |
47 SCHEME_DIGEST, | 46 SCHEME_DIGEST, |
48 SCHEME_OTHER | 47 SCHEME_OTHER |
49 } scheme; | 48 } scheme; |
50 | 49 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Returns true if this match was found using public suffix matching. | 183 // Returns true if this match was found using public suffix matching. |
185 bool IsPublicSuffixMatch() const; | 184 bool IsPublicSuffixMatch() const; |
186 | 185 |
187 PasswordForm(); | 186 PasswordForm(); |
188 ~PasswordForm(); | 187 ~PasswordForm(); |
189 }; | 188 }; |
190 | 189 |
191 // Map username to PasswordForm* for convenience. See password_form_manager.h. | 190 // Map username to PasswordForm* for convenience. See password_form_manager.h. |
192 typedef std::map<string16, PasswordForm*> PasswordFormMap; | 191 typedef std::map<string16, PasswordForm*> PasswordFormMap; |
193 | 192 |
194 } // namespace content | 193 } // namespace autofill |
195 | 194 |
196 #endif // CONTENT_PUBLIC_COMMON_PASSWORD_FORM_H__ | 195 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |