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

Side by Side Diff: components/autofill/common/password_form_fill_data.h

Issue 15660018: [autofill] Add support for PSL domain matching for password autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated regexp, sanitized result, escaped form domain and added comments. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 10 matching lines...) Expand all
21 // Defined so that this struct can be used as a key in a std::map. 21 // Defined so that this struct can be used as a key in a std::map.
22 bool operator<(const UsernamesCollectionKey& other) const; 22 bool operator<(const UsernamesCollectionKey& other) const;
23 23
24 base::string16 username; 24 base::string16 username;
25 base::string16 password; 25 base::string16 password;
26 }; 26 };
27 27
28 // Structure used for autofilling password forms. 28 // Structure used for autofilling password forms.
29 // basic_data identifies the HTML form on the page and preferred username/ 29 // basic_data identifies the HTML form on the page and preferred username/
30 // password for login, while 30 // password for login, while
31 // additional_logins is a list of other matching user/pass pairs for the form. 31 // preferred_realm the signon realm of the preferred user/pass pair.
32 // additional_logins_passwords is a list of other matching user/pass pairs for
33 // the form.
34 // additional_logins_realms is a list of the realms of other matching user/pass
35 // for the form.
Ilya Sherman 2013/06/06 09:25:35 I don't quite understand: Are these supposed to b
nyquist 2013/06/07 22:51:10 Done.
32 // other_possible_usernames is a list of possible usernames in the case where we 36 // other_possible_usernames is a list of possible usernames in the case where we
33 // aren't completely sure that the original saved username is correct. 37 // aren't completely sure that the original saved username is correct.
34 // This data is keyed by the saved username/password to ensure uniqueness, 38 // This data is keyed by the saved username/password to ensure uniqueness,
35 // though the username is not used. 39 // though the username is not used.
36 // wait_for_username tells us whether we need to wait for the user to enter 40 // wait_for_username tells us whether we need to wait for the user to enter
37 // a valid username before we autofill the password. By default, this is off 41 // a valid username before we autofill the password. By default, this is off
38 // unless the PasswordManager determined there is an additional risk 42 // unless the PasswordManager determined there is an additional risk
39 // associated with this form. This can happen, for example, if action URI's 43 // associated with this form. This can happen, for example, if action URI's
40 // of the observed form and our saved representation don't match up. 44 // of the observed form and our saved representation don't match up.
41 struct PasswordFormFillData { 45 struct PasswordFormFillData {
42 typedef std::map<base::string16, base::string16> LoginCollection; 46 typedef std::map<base::string16, base::string16> LoginCollection;
43 typedef std::map<UsernamesCollectionKey, 47 typedef std::map<UsernamesCollectionKey,
44 std::vector<base::string16> > UsernamesCollection; 48 std::vector<base::string16> > UsernamesCollection;
45 49
46 FormData basic_data; 50 FormData basic_data;
47 LoginCollection additional_logins; 51 base::string16 preferred_realm;
52 LoginCollection additional_logins_passwords;
53 LoginCollection additional_logins_realms;
48 UsernamesCollection other_possible_usernames; 54 UsernamesCollection other_possible_usernames;
49 bool wait_for_username; 55 bool wait_for_username;
50 PasswordFormFillData(); 56 PasswordFormFillData();
51 ~PasswordFormFillData(); 57 ~PasswordFormFillData();
52 }; 58 };
53 59
54 // Create a FillData structure in preparation for autofilling a form, 60 // Create a FillData structure in preparation for autofilling a form,
55 // from basic_data identifying which form to fill, and a collection of 61 // from basic_data identifying which form to fill, and a collection of
56 // matching stored logins to use as username/password values. 62 // matching stored logins to use as username/password values.
57 // |preferred_match| should equal (address) one of matches. 63 // |preferred_match| should equal (address) one of matches.
58 // |wait_for_username_before_autofill| is true if we should not autofill 64 // |wait_for_username_before_autofill| is true if we should not autofill
59 // anything until the user typed in a valid username and blurred the field. 65 // anything until the user typed in a valid username and blurred the field.
60 // If |enable_possible_usernames| is true, we will populate possible_usernames 66 // If |enable_possible_usernames| is true, we will populate possible_usernames
61 // in |result|. 67 // in |result|.
62 void InitPasswordFormFillData( 68 void InitPasswordFormFillData(
63 const content::PasswordForm& form_on_page, 69 const content::PasswordForm& form_on_page,
64 const content::PasswordFormMap& matches, 70 const content::PasswordFormMap& matches,
65 const content::PasswordForm* const preferred_match, 71 const content::PasswordForm* const preferred_match,
66 bool wait_for_username_before_autofill, 72 bool wait_for_username_before_autofill,
67 bool enable_other_possible_usernames, 73 bool enable_other_possible_usernames,
68 PasswordFormFillData* result); 74 PasswordFormFillData* result);
69 75
70 } // namespace autofill 76 } // namespace autofill
71 77
72 #endif // COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H__ 78 #endif // COMPONENTS_AUTOFILL_COMMON_PASSWORD_FORM_FILL_DATA_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698