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