Index: webkit/forms/password_form_dom_manager.h |
=================================================================== |
--- webkit/forms/password_form_dom_manager.h (revision 127980) |
+++ webkit/forms/password_form_dom_manager.h (working copy) |
@@ -29,12 +29,34 @@ |
// of the observed form and our saved representation don't match up. |
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/22 16:57:44
There should be no need to add this enum -- you ca
Yumikiyo Osanai
2012/03/26 21:23:43
Umm... You are right, it seems to be it's a bit ve
|
+ // You should set a password basic_data.fields[0]. |
+ // If there's a username, you should set the username basic_data.fields[1]. |
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; |
Ilya Sherman
2012/03/22 16:57:44
There should be no need to add these methods. Thi
Yumikiyo Osanai
2012/03/26 21:23:43
I agree with your idea.
I remove these member meth
|
}; |
class PasswordFormDomManager { |