OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 // conceivable that a user (or ui test) could attempt to submit a login | 77 // conceivable that a user (or ui test) could attempt to submit a login |
78 // prompt before the callback has occured, which would InvokeLater a call to | 78 // prompt before the callback has occured, which would InvokeLater a call to |
79 // PasswordManager::ProvisionallySave, which would interact with this object | 79 // PasswordManager::ProvisionallySave, which would interact with this object |
80 // before the db has had time to answer with matching password entries. | 80 // before the db has had time to answer with matching password entries. |
81 // This is intended to be a one-time check; if the return value is false the | 81 // This is intended to be a one-time check; if the return value is false the |
82 // expectation is caller will give up. This clearly won't work if you put it | 82 // expectation is caller will give up. This clearly won't work if you put it |
83 // in a loop and wait for matching to complete; you're (supposed to be) on | 83 // in a loop and wait for matching to complete; you're (supposed to be) on |
84 // the same thread! | 84 // the same thread! |
85 bool HasCompletedMatching() const; | 85 bool HasCompletedMatching() const; |
86 | 86 |
87 // Returns true if the observed form has both the current and new password | 87 // Returns true if the |candidate| form has both the current and new password |
vabr (Chromium)
2015/02/10 18:54:57
Most of this comment is out of date, please improv
vabr (Chromium)
2015/02/10 18:54:57
I have another slight problem with the current wor
Pritam Nikam
2015/02/19 11:18:48
Done.
Pritam Nikam
2015/02/19 11:18:48
Done.
| |
88 // fields, and the username field was not explicitly marked with | 88 // fields, and the username field was not explicitly marked with |
89 // autocomplete=username. In these cases it is not clear whether the username | 89 // autocomplete=username. In these cases it is not clear whether the username |
90 // field is the right guess (often such change password forms do not contain | 90 // field is the right guess (often such change password forms do not contain |
91 // the username at all), and the user should not be bothered with saving a | 91 // the username at all), and the user should not be bothered with saving a |
92 // potentially malformed credential. Once we handle change password forms | 92 // potentially malformed credential. Once we handle change password forms |
93 // correctly, or http://crbug.com/448351 gets implemented, this method should | 93 // correctly, or http://crbug.com/448351 gets implemented, this method should |
94 // be replaced accordingly. | 94 // be replaced accordingly. |
95 bool IsIgnorableChangePasswordForm() const; | 95 bool IsIgnorableChangePasswordForm( |
96 const autofill::PasswordForm& candidate) const; | |
96 | 97 |
97 // Determines if the user opted to 'never remember' passwords for this form. | 98 // Determines if the user opted to 'never remember' passwords for this form. |
98 bool IsBlacklisted() const; | 99 bool IsBlacklisted() const; |
99 | 100 |
100 // Used by PasswordManager to determine whether or not to display | 101 // Used by PasswordManager to determine whether or not to display |
101 // a SavePasswordBar when given the green light to save the PasswordForm | 102 // a SavePasswordBar when given the green light to save the PasswordForm |
102 // managed by this. | 103 // managed by this. |
103 bool IsNewLogin() const; | 104 bool IsNewLogin() const; |
104 | 105 |
105 // Returns true if the current pending credentials were found using | 106 // Returns true if the current pending credentials were found using |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 | 276 |
276 // Remove possible_usernames that may contains sensitive information and | 277 // Remove possible_usernames that may contains sensitive information and |
277 // duplicates. | 278 // duplicates. |
278 void SanitizePossibleUsernames(autofill::PasswordForm* form); | 279 void SanitizePossibleUsernames(autofill::PasswordForm* form); |
279 | 280 |
280 // Helper function to delegate uploading to the AutofillManager. | 281 // Helper function to delegate uploading to the AutofillManager. |
281 virtual void UploadPasswordForm( | 282 virtual void UploadPasswordForm( |
282 const autofill::FormData& form_data, | 283 const autofill::FormData& form_data, |
283 const autofill::ServerFieldType& password_type); | 284 const autofill::ServerFieldType& password_type); |
284 | 285 |
286 // Returns true if |candidate|'s username and password field value matches | |
vabr (Chromium)
2015/02/10 18:54:57
To avoid increasing the header file, I suggest cha
Pritam Nikam
2015/02/19 11:18:48
Done.
| |
287 // with one of the stored password form within |best_matches_|; otherwise | |
288 // false. | |
289 bool HasMatchingCredentialsInStore( | |
290 const autofill::PasswordForm& candidate) const; | |
291 | |
285 // Set of PasswordForms from the DB that best match the form | 292 // Set of PasswordForms from the DB that best match the form |
286 // being managed by this. Use a map instead of vector, because we most | 293 // being managed by this. Use a map instead of vector, because we most |
287 // frequently require lookups by username value in IsNewLogin. | 294 // frequently require lookups by username value in IsNewLogin. |
288 autofill::PasswordFormMap best_matches_; | 295 autofill::PasswordFormMap best_matches_; |
289 | 296 |
290 // Cleans up when best_matches_ goes out of scope. | 297 // Cleans up when best_matches_ goes out of scope. |
291 STLValueDeleter<autofill::PasswordFormMap> best_matches_deleter_; | 298 STLValueDeleter<autofill::PasswordFormMap> best_matches_deleter_; |
292 | 299 |
293 // The PasswordForm from the page or dialog managed by |this|. | 300 // The PasswordForm from the page or dialog managed by |this|. |
294 const autofill::PasswordForm observed_form_; | 301 const autofill::PasswordForm observed_form_; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
353 ManagerAction manager_action_; | 360 ManagerAction manager_action_; |
354 UserAction user_action_; | 361 UserAction user_action_; |
355 SubmitResult submit_result_; | 362 SubmitResult submit_result_; |
356 | 363 |
357 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 364 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
358 }; | 365 }; |
359 | 366 |
360 } // namespace password_manager | 367 } // namespace password_manager |
361 | 368 |
362 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 369 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
OLD | NEW |