| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Checks if the form is a valid password form. Forms which lack either | 65 // Checks if the form is a valid password form. Forms which lack either |
| 66 // login or password field are not considered valid. | 66 // login or password field are not considered valid. |
| 67 bool HasValidPasswordForm(); | 67 bool HasValidPasswordForm(); |
| 68 | 68 |
| 69 // Determines if we need to autofill given the results of the query. | 69 // Determines if we need to autofill given the results of the query. |
| 70 void OnRequestDone( | 70 void OnRequestDone( |
| 71 int handle, const std::vector<webkit_glue::PasswordForm*>& result); | 71 int handle, const std::vector<webkit_glue::PasswordForm*>& result); |
| 72 | 72 |
| 73 // PasswordStoreConsumer implementation. | 73 // PasswordStoreConsumer implementation. |
| 74 virtual void OnPasswordStoreRequestDone( | 74 virtual void OnPasswordStoreRequestDone( |
| 75 int handle, const std::vector<webkit_glue::PasswordForm*>& result); | 75 PasswordStore::Handle handle, |
| 76 const std::vector<webkit_glue::PasswordForm*>& result); |
| 76 | 77 |
| 77 // A user opted to 'never remember' passwords for this form. | 78 // A user opted to 'never remember' passwords for this form. |
| 78 // Blacklist it so that from now on when it is seen we ignore it. | 79 // Blacklist it so that from now on when it is seen we ignore it. |
| 79 void PermanentlyBlacklist(); | 80 void PermanentlyBlacklist(); |
| 80 | 81 |
| 81 // If the user has submitted observed_form_, provisionally hold on to | 82 // If the user has submitted observed_form_, provisionally hold on to |
| 82 // the submitted credentials until we are told by PasswordManager whether | 83 // the submitted credentials until we are told by PasswordManager whether |
| 83 // or not the login was successful. | 84 // or not the login was successful. |
| 84 void ProvisionallySave(const webkit_glue::PasswordForm& credentials); | 85 void ProvisionallySave(const webkit_glue::PasswordForm& credentials); |
| 85 | 86 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 kSubmitResultFailed, | 130 kSubmitResultFailed, |
| 130 kSubmitResultPassed, | 131 kSubmitResultPassed, |
| 131 kSubmitResultMax | 132 kSubmitResultMax |
| 132 }; | 133 }; |
| 133 | 134 |
| 134 // The maximum number of combinations of the three preceding enums. | 135 // The maximum number of combinations of the three preceding enums. |
| 135 // This is used when recording the actions taken by the form in UMA. | 136 // This is used when recording the actions taken by the form in UMA. |
| 136 static const int kMaxNumActionsTaken = kManagerActionMax * kUserActionMax * | 137 static const int kMaxNumActionsTaken = kManagerActionMax * kUserActionMax * |
| 137 kSubmitResultMax; | 138 kSubmitResultMax; |
| 138 | 139 |
| 139 // Called by destructor to ensure if this object is deleted, no potential | |
| 140 // outstanding callbacks can call OnPasswordStoreRequestDone. | |
| 141 void CancelLoginsQuery(); | |
| 142 | |
| 143 // Helper for OnPasswordStoreRequestDone to determine whether or not | 140 // Helper for OnPasswordStoreRequestDone to determine whether or not |
| 144 // the given result form is worth scoring. | 141 // the given result form is worth scoring. |
| 145 bool IgnoreResult(const webkit_glue::PasswordForm& form) const; | 142 bool IgnoreResult(const webkit_glue::PasswordForm& form) const; |
| 146 | 143 |
| 147 // Helper for Save in the case that best_matches.size() == 0, meaning | 144 // Helper for Save in the case that best_matches.size() == 0, meaning |
| 148 // we have no prior record of this form/username/password and the user | 145 // we have no prior record of this form/username/password and the user |
| 149 // has opted to 'Save Password'. If |reset_preferred_login| is set, | 146 // has opted to 'Save Password'. If |reset_preferred_login| is set, |
| 150 // the previously preferred login from |best_matches_| will be reset. | 147 // the previously preferred login from |best_matches_| will be reset. |
| 151 void SaveAsNewLogin(bool reset_preferred_login); | 148 void SaveAsNewLogin(bool reset_preferred_login); |
| 152 | 149 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // These three fields record the "ActionsTaken" by the browser and | 222 // These three fields record the "ActionsTaken" by the browser and |
| 226 // the user with this form, and the result. They are combined and | 223 // the user with this form, and the result. They are combined and |
| 227 // recorded in UMA when the manager is destroyed. | 224 // recorded in UMA when the manager is destroyed. |
| 228 ManagerAction manager_action_; | 225 ManagerAction manager_action_; |
| 229 UserAction user_action_; | 226 UserAction user_action_; |
| 230 SubmitResult submit_result_; | 227 SubmitResult submit_result_; |
| 231 | 228 |
| 232 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 229 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
| 233 }; | 230 }; |
| 234 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 231 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
| OLD | NEW |