Chromium Code Reviews| Index: webkit/forms/password_form_dom_manager.h |
| =================================================================== |
| --- webkit/forms/password_form_dom_manager.h (revision 127673) |
| +++ webkit/forms/password_form_dom_manager.h (working copy) |
| @@ -30,11 +30,39 @@ |
| struct WEBKIT_FORMS_EXPORT PasswordFormFillData { |
| typedef std::map<string16, string16> LoginCollection; |
| + // It used to express the kinds of datas that the instance has. |
| + enum DataType { |
| + kUsernameAndPassword = 0, |
| + kOnlyPassword, |
| + kError, // the instance has wrong datas. |
| + }; |
|
Ilya Sherman
2012/03/20 23:39:43
Hmm, I don't much like all this extra complexity i
Yumikiyo Osanai
2012/03/21 18:01:37
I've changed to reverse the order of username and
|
| + |
| + // You should set username and password in basic_data as below. |
| + // 1. If you would like to set a username and a password in it, |
| + // - You should set the username basic_data.fields[0] |
| + // - You should set the password basic_data.fields[1] |
| + // 2. If you would like to set only a password in it, |
| + // - You should set the password basic_data.fields[0] |
| FormData basic_data; |
| LoginCollection additional_logins; |
| bool wait_for_username; |
| + |
| PasswordFormFillData(); |
| ~PasswordFormFillData(); |
| + |
| + // Get the username field from basic_data. |
| + // If it hasn't any username, calls NOTREACHED(). |
| + const FormField& GetUsernameField() const; |
| + |
| + // Get the username field from basic_data. |
| + const FormField& GetPasswordField() const; |
| + |
| + // Get the DataType. |
| + // This function judge the datatype with basic_data. |
| + // If basic_data.size() == 2, it judges I have username and password. |
| + // If basic_data.size() == 1, it judges I have only password. |
| + // Otherwise, it judges I have wrong datas. |
| + DataType GetDataType() const; |
| }; |
| class PasswordFormDomManager { |