| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 WEBKIT_GLUE_PASSWORD_FORM_H__ | 5 #ifndef WEBKIT_GLUE_PASSWORD_FORM_H__ |
| 6 #define WEBKIT_GLUE_PASSWORD_FORM_H__ | 6 #define WEBKIT_GLUE_PASSWORD_FORM_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPasswordFormData.h
" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPasswordFormData.h
" |
| 14 #include "webkit/glue/webkit_glue_export.h" |
| 14 | 15 |
| 15 namespace webkit_glue { | 16 namespace webkit_glue { |
| 16 | 17 |
| 17 // The PasswordForm struct encapsulates information about a login form, | 18 // The PasswordForm struct encapsulates information about a login form, |
| 18 // which can be an HTML form or a dialog with username/password text fields. | 19 // which can be an HTML form or a dialog with username/password text fields. |
| 19 // | 20 // |
| 20 // The Web Data database stores saved username/passwords and associated form | 21 // The Web Data database stores saved username/passwords and associated form |
| 21 // metdata using a PasswordForm struct, typically one that was created from | 22 // metdata using a PasswordForm struct, typically one that was created from |
| 22 // a parsed HTMLFormElement or LoginDialog, but the saved entries could have | 23 // a parsed HTMLFormElement or LoginDialog, but the saved entries could have |
| 23 // also been created by imported data from another browser. | 24 // also been created by imported data from another browser. |
| 24 // | 25 // |
| 25 // The PasswordManager implements a fuzzy-matching algorithm to compare saved | 26 // The PasswordManager implements a fuzzy-matching algorithm to compare saved |
| 26 // PasswordForm entries against PasswordForms that were created from a parsed | 27 // PasswordForm entries against PasswordForms that were created from a parsed |
| 27 // HTML or dialog form. As one might expect, the more data contained in one | 28 // HTML or dialog form. As one might expect, the more data contained in one |
| 28 // of the saved PasswordForms, the better the job the PasswordManager can do | 29 // of the saved PasswordForms, the better the job the PasswordManager can do |
| 29 // in matching it against the actual form it was saved on, and autofill | 30 // in matching it against the actual form it was saved on, and autofill |
| 30 // accurately. But it is not always possible, especially when importing from | 31 // accurately. But it is not always possible, especially when importing from |
| 31 // other browsers with different data models, to copy over all the information | 32 // other browsers with different data models, to copy over all the information |
| 32 // about a particular "saved password entry" to our PasswordForm | 33 // about a particular "saved password entry" to our PasswordForm |
| 33 // representation. | 34 // representation. |
| 34 // | 35 // |
| 35 // The field descriptions in the struct specification below are intended to | 36 // The field descriptions in the struct specification below are intended to |
| 36 // describe which fields are not strictly required when adding a saved password | 37 // describe which fields are not strictly required when adding a saved password |
| 37 // entry to the database and how they can affect the matching process. | 38 // entry to the database and how they can affect the matching process. |
| 38 | 39 |
| 39 struct PasswordForm { | 40 struct WEBKIT_GLUE_EXPORT PasswordForm { |
| 40 // Enum to differentiate between HTML form based authentication, and dialogs | 41 // Enum to differentiate between HTML form based authentication, and dialogs |
| 41 // using basic or digest schemes. Default is SCHEME_HTML. Only PasswordForms | 42 // using basic or digest schemes. Default is SCHEME_HTML. Only PasswordForms |
| 42 // of the same Scheme will be matched/autofilled against each other. | 43 // of the same Scheme will be matched/autofilled against each other. |
| 43 enum Scheme { | 44 enum Scheme { |
| 44 SCHEME_HTML, | 45 SCHEME_HTML, |
| 45 SCHEME_BASIC, | 46 SCHEME_BASIC, |
| 46 SCHEME_DIGEST, | 47 SCHEME_DIGEST, |
| 47 SCHEME_OTHER | 48 SCHEME_OTHER |
| 48 } scheme; | 49 } scheme; |
| 49 | 50 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 PasswordForm(const WebKit::WebPasswordFormData& web_password_form); | 140 PasswordForm(const WebKit::WebPasswordFormData& web_password_form); |
| 140 ~PasswordForm(); | 141 ~PasswordForm(); |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 // Map username to PasswordForm* for convenience. See password_form_manager.h. | 144 // Map username to PasswordForm* for convenience. See password_form_manager.h. |
| 144 typedef std::map<string16, PasswordForm*> PasswordFormMap; | 145 typedef std::map<string16, PasswordForm*> PasswordFormMap; |
| 145 | 146 |
| 146 } // namespace webkit_glue | 147 } // namespace webkit_glue |
| 147 | 148 |
| 148 #endif // WEBKIT_GLUE_PASSWORD_FORM_H__ | 149 #endif // WEBKIT_GLUE_PASSWORD_FORM_H__ |
| OLD | NEW |