| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_I
MPL_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_I
MPL_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_I
MPL_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_I
MPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const GetCallback& callback) override; | 60 const GetCallback& callback) override; |
| 61 | 61 |
| 62 // CredentialManagerPendingRequestTaskDelegate: | 62 // CredentialManagerPendingRequestTaskDelegate: |
| 63 bool IsZeroClickAllowed() const override; | 63 bool IsZeroClickAllowed() const override; |
| 64 GURL GetOrigin() const override; | 64 GURL GetOrigin() const override; |
| 65 void SendCredential(const SendCredentialCallback& send_callback, | 65 void SendCredential(const SendCredentialCallback& send_callback, |
| 66 const CredentialInfo& info) override; | 66 const CredentialInfo& info) override; |
| 67 void SendPasswordForm(const SendCredentialCallback& send_callback, | 67 void SendPasswordForm(const SendCredentialCallback& send_callback, |
| 68 const autofill::PasswordForm* form) override; | 68 const autofill::PasswordForm* form) override; |
| 69 PasswordManagerClient* client() const override; | 69 PasswordManagerClient* client() const override; |
| 70 PasswordStore::FormDigest GetSynthesizedFormForOrigin() const override; | |
| 71 | 70 |
| 72 // CredentialManagerPendingSignedOutTaskDelegate: | 71 // CredentialManagerPendingSignedOutTaskDelegate: |
| 73 PasswordStore* GetPasswordStore() override; | 72 PasswordStore* GetPasswordStore() override; |
| 74 void DoneRequiringUserMediation() override; | 73 void DoneRequiringUserMediation() override; |
| 75 | 74 |
| 76 // CredentialManagerPasswordFormManagerDelegate: | 75 // CredentialManagerPasswordFormManagerDelegate: |
| 77 void OnProvisionalSaveComplete() override; | 76 void OnProvisionalSaveComplete() override; |
| 78 | 77 |
| 78 // Returns FormDigest for the current URL. |
| 79 PasswordStore::FormDigest GetSynthesizedFormForOrigin() const; |
| 80 |
| 79 private: | 81 private: |
| 80 // Returns the driver for the current main frame. | 82 // Returns the driver for the current main frame. |
| 81 // Virtual for testing. | 83 // Virtual for testing. |
| 82 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); | 84 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); |
| 83 | 85 |
| 84 // Schedules a CredentiaManagerPendingRequestTask (during | |
| 85 // |OnRequestCredential()|) after the PasswordStore's AffiliationMatchHelper | |
| 86 // grabs a list of realms related to the current web origin. | |
| 87 void ScheduleRequestTask(const GetCallback& callback, | |
| 88 bool zero_click_only, | |
| 89 bool include_passwords, | |
| 90 const std::vector<GURL>& federations, | |
| 91 const std::vector<std::string>& android_realms); | |
| 92 | |
| 93 PasswordManagerClient* client_; | 86 PasswordManagerClient* client_; |
| 94 std::unique_ptr<CredentialManagerPasswordFormManager> form_manager_; | 87 std::unique_ptr<CredentialManagerPasswordFormManager> form_manager_; |
| 95 | 88 |
| 96 // Set to false to disable automatic signing in. | 89 // Set to false to disable automatic signing in. |
| 97 BooleanPrefMember auto_signin_enabled_; | 90 BooleanPrefMember auto_signin_enabled_; |
| 98 | 91 |
| 99 // When 'OnRequestCredential' is called, it in turn calls out to the | 92 // When 'OnRequestCredential' is called, it in turn calls out to the |
| 100 // PasswordStore; we push enough data into Pending*Task objects so that | 93 // PasswordStore; we push enough data into Pending*Task objects so that |
| 101 // they can properly respond to the request once the PasswordStore gives | 94 // they can properly respond to the request once the PasswordStore gives |
| 102 // us data. | 95 // us data. |
| 103 std::unique_ptr<CredentialManagerPendingRequestTask> pending_request_; | 96 std::unique_ptr<CredentialManagerPendingRequestTask> pending_request_; |
| 104 std::unique_ptr<CredentialManagerPendingRequireUserMediationTask> | 97 std::unique_ptr<CredentialManagerPendingRequireUserMediationTask> |
| 105 pending_require_user_mediation_; | 98 pending_require_user_mediation_; |
| 106 | 99 |
| 107 mojo::BindingSet<mojom::CredentialManager> bindings_; | 100 mojo::BindingSet<mojom::CredentialManager> bindings_; |
| 108 | 101 |
| 109 base::WeakPtrFactory<CredentialManagerImpl> weak_factory_; | 102 base::WeakPtrFactory<CredentialManagerImpl> weak_factory_; |
| 110 | 103 |
| 111 DISALLOW_COPY_AND_ASSIGN(CredentialManagerImpl); | 104 DISALLOW_COPY_AND_ASSIGN(CredentialManagerImpl); |
| 112 }; | 105 }; |
| 113 | 106 |
| 114 } // namespace password_manager | 107 } // namespace password_manager |
| 115 | 108 |
| 116 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_IMPL_H_ | 109 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_IMPL_H_ |
| OLD | NEW |