| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H_ | 5 #ifndef COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H_ |
| 6 #define COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H_ | 6 #define COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "components/autofill/common/autofill_export.h" |
| 11 #include "components/autofill/common/form_data.h" | 12 #include "components/autofill/common/form_data.h" |
| 12 #include "content/public/common/password_form.h" | 13 #include "content/public/common/password_form.h" |
| 13 | 14 |
| 14 namespace autofill { | 15 namespace autofill { |
| 15 | 16 |
| 16 // Structure used for autofilling password forms. | 17 // Structure used for autofilling password forms. |
| 17 // basic_data identifies the HTML form on the page and preferred username/ | 18 // basic_data identifies the HTML form on the page and preferred username/ |
| 18 // password for login, while | 19 // password for login, while |
| 19 // additional_logins is a list of other matching user/pass pairs for the form. | 20 // additional_logins is a list of other matching user/pass pairs for the form. |
| 20 // wait_for_username tells us whether we need to wait for the user to enter | 21 // wait_for_username tells us whether we need to wait for the user to enter |
| 21 // a valid username before we autofill the password. By default, this is off | 22 // a valid username before we autofill the password. By default, this is off |
| 22 // unless the PasswordManager determined there is an additional risk | 23 // unless the PasswordManager determined there is an additional risk |
| 23 // associated with this form. This can happen, for example, if action URI's | 24 // associated with this form. This can happen, for example, if action URI's |
| 24 // of the observed form and our saved representation don't match up. | 25 // of the observed form and our saved representation don't match up. |
| 25 struct PasswordFormFillData { | 26 struct AUTOFILL_EXPORT PasswordFormFillData { |
| 26 typedef std::map<base::string16, base::string16> LoginCollection; | 27 typedef std::map<base::string16, base::string16> LoginCollection; |
| 27 | 28 |
| 28 FormData basic_data; | 29 FormData basic_data; |
| 29 LoginCollection additional_logins; | 30 LoginCollection additional_logins; |
| 30 bool wait_for_username; | 31 bool wait_for_username; |
| 31 PasswordFormFillData(); | 32 PasswordFormFillData(); |
| 32 ~PasswordFormFillData(); | 33 ~PasswordFormFillData(); |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 // Create a FillData structure in preparation for autofilling a form, | 36 // Create a FillData structure in preparation for autofilling a form, |
| 36 // from basic_data identifying which form to fill, and a collection of | 37 // from basic_data identifying which form to fill, and a collection of |
| 37 // matching stored logins to use as username/password values. | 38 // matching stored logins to use as username/password values. |
| 38 // preferred_match should equal (address) one of matches. | 39 // preferred_match should equal (address) one of matches. |
| 39 // wait_for_username_before_autofill is true if we should not autofill | 40 // wait_for_username_before_autofill is true if we should not autofill |
| 40 // anything until the user typed in a valid username and blurred the field. | 41 // anything until the user typed in a valid username and blurred the field. |
| 41 void InitPasswordFormFillData( | 42 void AUTOFILL_EXPORT InitPasswordFormFillData( |
| 42 const content::PasswordForm& form_on_page, | 43 const content::PasswordForm& form_on_page, |
| 43 const content::PasswordFormMap& matches, | 44 const content::PasswordFormMap& matches, |
| 44 const content::PasswordForm* const preferred_match, | 45 const content::PasswordForm* const preferred_match, |
| 45 bool wait_for_username_before_autofill, | 46 bool wait_for_username_before_autofill, |
| 46 PasswordFormFillData* result); | 47 PasswordFormFillData* result); |
| 47 | 48 |
| 48 } // namespace autofill | 49 } // namespace autofill |
| 49 | 50 |
| 50 #endif // COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H__ | 51 #endif // COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H__ |
| OLD | NEW |