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_FORMS_PASSWORD_FORM_DOM_MANAGER_H_ | 5 #ifndef WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H_ |
6 #define WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H_ | 6 #define WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "webkit/forms/form_data.h" | 10 #include "webkit/forms/form_data.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // password for login, while | 23 // password for login, while |
24 // additional_logins is a list of other matching user/pass pairs for the form. | 24 // additional_logins is a list of other matching user/pass pairs for the form. |
25 // wait_for_username tells us whether we need to wait for the user to enter | 25 // wait_for_username tells us whether we need to wait for the user to enter |
26 // a valid username before we autofill the password. By default, this is off | 26 // a valid username before we autofill the password. By default, this is off |
27 // unless the PasswordManager determined there is an additional risk | 27 // unless the PasswordManager determined there is an additional risk |
28 // associated with this form. This can happen, for example, if action URI's | 28 // associated with this form. This can happen, for example, if action URI's |
29 // of the observed form and our saved representation don't match up. | 29 // of the observed form and our saved representation don't match up. |
30 struct WEBKIT_FORMS_EXPORT PasswordFormFillData { | 30 struct WEBKIT_FORMS_EXPORT PasswordFormFillData { |
31 typedef std::map<string16, string16> LoginCollection; | 31 typedef std::map<string16, string16> LoginCollection; |
32 | 32 |
| 33 // You should set a password basic_data.fields[0]. |
| 34 // If there's a username, you should set the username basic_data.fields[1]. |
| 35 // So, If basic_data.size() == 2, we judge it has username and password. |
| 36 // And, basic_data.size() == 1, we judge it has only password. |
| 37 // Otherwise, we supporse that it has wrong datas. |
33 FormData basic_data; | 38 FormData basic_data; |
34 LoginCollection additional_logins; | 39 LoginCollection additional_logins; |
35 bool wait_for_username; | 40 bool wait_for_username; |
36 PasswordFormFillData(); | 41 PasswordFormFillData(); |
37 ~PasswordFormFillData(); | 42 ~PasswordFormFillData(); |
38 }; | 43 }; |
39 | 44 |
40 class PasswordFormDomManager { | 45 class PasswordFormDomManager { |
41 public: | 46 public: |
42 // Create a PasswordForm from DOM form. Webkit doesn't allow storing | 47 // Create a PasswordForm from DOM form. Webkit doesn't allow storing |
(...skipping 15 matching lines...) Expand all Loading... |
58 bool wait_for_username_before_autofill, | 63 bool wait_for_username_before_autofill, |
59 PasswordFormFillData* result); | 64 PasswordFormFillData* result); |
60 private: | 65 private: |
61 DISALLOW_IMPLICIT_CONSTRUCTORS(PasswordFormDomManager); | 66 DISALLOW_IMPLICIT_CONSTRUCTORS(PasswordFormDomManager); |
62 }; | 67 }; |
63 | 68 |
64 } // namespace forms | 69 } // namespace forms |
65 } // namespace webkit | 70 } // namespace webkit |
66 | 71 |
67 #endif // WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H__ | 72 #endif // WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H__ |
OLD | NEW |