Index: content/public/common/password_form_fill_data.h |
diff --git a/content/public/common/password_form_fill_data.h b/content/public/common/password_form_fill_data.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aef91aa14fb1053d5f42b1f5954815c7e0016c6e |
--- /dev/null |
+++ b/content/public/common/password_form_fill_data.h |
@@ -0,0 +1,51 @@ |
+// Copyright 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_PUBLIC_COMMON_PASSWORD_FORM_FILL_DATA_H_ |
+#define CONTENT_PUBLIC_COMMON_PASSWORD_FORM_FILL_DATA_H_ |
+ |
+#include <map> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "content/common/content_export.h" |
+#include "content/public/common/form_data.h" |
+#include "content/public/common/password_form.h" |
+ |
+namespace content { |
+ |
+// Structure used for autofilling password forms. |
+// basic_data identifies the HTML form on the page and preferred username/ |
+// password for login, while |
+// additional_logins is a list of other matching user/pass pairs for the form. |
+// wait_for_username tells us whether we need to wait for the user to enter |
+// a valid username before we autofill the password. By default, this is off |
+// unless the PasswordManager determined there is an additional risk |
+// associated with this form. This can happen, for example, if action URI's |
+// of the observed form and our saved representation don't match up. |
+struct CONTENT_EXPORT PasswordFormFillData { |
+ typedef std::map<string16, string16> LoginCollection; |
+ |
+ FormData basic_data; |
+ LoginCollection additional_logins; |
+ bool wait_for_username; |
+ PasswordFormFillData(); |
+ ~PasswordFormFillData(); |
+}; |
+ |
+// Create a FillData structure in preparation for autofilling a form, |
+// from basic_data identifying which form to fill, and a collection of |
+// matching stored logins to use as username/password values. |
+// preferred_match should equal (address) one of matches. |
+// wait_for_username_before_autofill is true if we should not autofill |
+// anything until the user typed in a valid username and blurred the field. |
+CONTENT_EXPORT void initPasswordFormFillData( |
stuartmorgan
2012/10/02 12:17:51
s/init/Init/
Should this be a static method on Pa
jam
2012/10/02 16:18:14
structs don't have methods per style guide, so you
blundell
2012/10/03 15:06:07
Done.
|
+ const PasswordForm& form_on_page, |
+ const PasswordFormMap& matches, |
+ const PasswordForm* const preferred_match, |
+ bool wait_for_username_before_autofill, |
+ PasswordFormFillData* result); |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_COMMON_PASSWORD_FORM_FILL_DATA_H__ |