| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Chooses between the current and new password value which one to save. This | 70 // Chooses between the current and new password value which one to save. This |
| 71 // is whichever is non-empty, with the preference being given to the new one. | 71 // is whichever is non-empty, with the preference being given to the new one. |
| 72 static base::string16 PasswordToSave(const autofill::PasswordForm& form); | 72 static base::string16 PasswordToSave(const autofill::PasswordForm& form); |
| 73 | 73 |
| 74 // Compares basic data of |observed_form_| with |form| and returns how much | 74 // Compares basic data of |observed_form_| with |form| and returns how much |
| 75 // they match. The return value is a MatchResultMask bitmask. | 75 // they match. The return value is a MatchResultMask bitmask. |
| 76 MatchResultMask DoesManage(const autofill::PasswordForm& form) const; | 76 MatchResultMask DoesManage(const autofill::PasswordForm& form) const; |
| 77 | 77 |
| 78 // Retrieves potential matching logins from the database. In addition the | 78 // Retrieves potential matching logins from the database. In addition the |
| 79 // statistics is retrived on platforms with the password bubble. | 79 // statistics is retrived on platforms with the password bubble. |
| 80 // |prompt_policy| indicates whether it's permissible to prompt the user to | 80 void FetchDataFromPasswordStore(); |
| 81 // authorize access to locked passwords. This argument is only used on | |
| 82 // platforms that support prompting the user for access (such as Mac OS). | |
| 83 void FetchDataFromPasswordStore( | |
| 84 PasswordStore::AuthorizationPromptPolicy prompt_policy); | |
| 85 | 81 |
| 86 // Simple state-check to verify whether this object as received a callback | 82 // Simple state-check to verify whether this object as received a callback |
| 87 // from the PasswordStore and completed its matching phase. Note that the | 83 // from the PasswordStore and completed its matching phase. Note that the |
| 88 // callback in question occurs on the same (and only) main thread from which | 84 // callback in question occurs on the same (and only) main thread from which |
| 89 // instances of this class are ever used, but it is required since it is | 85 // instances of this class are ever used, but it is required since it is |
| 90 // conceivable that a user (or ui test) could attempt to submit a login | 86 // conceivable that a user (or ui test) could attempt to submit a login |
| 91 // prompt before the callback has occured, which would InvokeLater a call to | 87 // prompt before the callback has occured, which would InvokeLater a call to |
| 92 // PasswordManager::ProvisionallySave, which would interact with this object | 88 // PasswordManager::ProvisionallySave, which would interact with this object |
| 93 // before the db has had time to answer with matching password entries. | 89 // before the db has had time to answer with matching password entries. |
| 94 // This is intended to be a one-time check; if the return value is false the | 90 // This is intended to be a one-time check; if the return value is false the |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 // recorded in UMA when the manager is destroyed. | 558 // recorded in UMA when the manager is destroyed. |
| 563 ManagerAction manager_action_; | 559 ManagerAction manager_action_; |
| 564 UserAction user_action_; | 560 UserAction user_action_; |
| 565 SubmitResult submit_result_; | 561 SubmitResult submit_result_; |
| 566 | 562 |
| 567 // Form type of the form that |this| is managing. Set after SetSubmittedForm() | 563 // Form type of the form that |this| is managing. Set after SetSubmittedForm() |
| 568 // as our classification of the form can change depending on what data the | 564 // as our classification of the form can change depending on what data the |
| 569 // user has entered. | 565 // user has entered. |
| 570 FormType form_type_; | 566 FormType form_type_; |
| 571 | 567 |
| 572 // Null unless FetchMatchingLoginsFromPasswordStore has been called again | 568 // False unless FetchMatchingLoginsFromPasswordStore has been called again |
| 573 // without the password store returning results in the meantime. In that case | 569 // without the password store returning results in the meantime. |
| 574 // this stores the prompt policy for the refresh call. | 570 bool need_to_refetch_; |
| 575 scoped_ptr<PasswordStore::AuthorizationPromptPolicy> next_prompt_policy_; | |
| 576 | 571 |
| 577 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 572 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
| 578 }; | 573 }; |
| 579 | 574 |
| 580 } // namespace password_manager | 575 } // namespace password_manager |
| 581 | 576 |
| 582 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 577 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
| OLD | NEW |