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