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

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: Modify the errors from Lint 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
« no previous file with comments | « chrome/renderer/autofill/password_autofill_manager.cc ('k') | webkit/forms/password_form_dom_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/renderer/autofill/password_autofill_manager.cc ('k') | webkit/forms/password_form_dom_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698