Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: webkit/forms/password_form_dom_manager.h

Issue 9625026: Save password without an associated username. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Delete a unintentional spaces Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698