| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CREDENTIAL_MANAGER_PENDING_REQU
EST_TASK_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_REQU
EST_TASK_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_REQU
EST_TASK_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_REQU
EST_TASK_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "components/password_manager/core/browser/http_password_store_migrator.
h" | 15 #include "components/password_manager/core/browser/http_password_store_migrator.
h" |
| 16 #include "components/password_manager/core/browser/password_store.h" | 16 #include "components/password_manager/core/browser/password_store.h" |
| 17 #include "components/password_manager/core/browser/password_store_consumer.h" | 17 #include "components/password_manager/core/browser/password_store_consumer.h" |
| 18 #include "components/password_manager/core/common/credential_manager_types.h" |
| 18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 19 | 20 |
| 20 namespace autofill { | 21 namespace autofill { |
| 21 struct PasswordForm; | 22 struct PasswordForm; |
| 22 } // namespace autofill | 23 } // namespace autofill |
| 23 | 24 |
| 24 namespace password_manager { | 25 namespace password_manager { |
| 25 | 26 |
| 26 struct CredentialInfo; | 27 struct CredentialInfo; |
| 27 class PasswordManagerClient; | 28 class PasswordManagerClient; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 // Returns the PasswordManagerClient. | 43 // Returns the PasswordManagerClient. |
| 43 virtual PasswordManagerClient* client() const = 0; | 44 virtual PasswordManagerClient* client() const = 0; |
| 44 | 45 |
| 45 // Sends a credential to JavaScript. | 46 // Sends a credential to JavaScript. |
| 46 virtual void SendCredential(const SendCredentialCallback& send_callback, | 47 virtual void SendCredential(const SendCredentialCallback& send_callback, |
| 47 const CredentialInfo& credential) = 0; | 48 const CredentialInfo& credential) = 0; |
| 48 | 49 |
| 49 // Updates |skip_zero_click| for |form| in the PasswordStore if required. | 50 // Updates |skip_zero_click| for |form| in the PasswordStore if required. |
| 50 // Sends a credential to JavaScript. | 51 // Sends a credential to JavaScript. |
| 51 virtual void SendPasswordForm(const SendCredentialCallback& send_callback, | 52 virtual void SendPasswordForm(const SendCredentialCallback& send_callback, |
| 53 CredentialMediationRequirement mediation, |
| 52 const autofill::PasswordForm* form) = 0; | 54 const autofill::PasswordForm* form) = 0; |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 // Retrieves credentials from the PasswordStore. | 57 // Retrieves credentials from the PasswordStore. |
| 56 class CredentialManagerPendingRequestTask | 58 class CredentialManagerPendingRequestTask |
| 57 : public PasswordStoreConsumer, | 59 : public PasswordStoreConsumer, |
| 58 public HttpPasswordStoreMigrator::Consumer { | 60 public HttpPasswordStoreMigrator::Consumer { |
| 59 public: | 61 public: |
| 60 CredentialManagerPendingRequestTask( | 62 CredentialManagerPendingRequestTask( |
| 61 CredentialManagerPendingRequestTaskDelegate* delegate, | 63 CredentialManagerPendingRequestTaskDelegate* delegate, |
| 62 const SendCredentialCallback& callback, | 64 const SendCredentialCallback& callback, |
| 63 bool request_zero_click_only, | 65 CredentialMediationRequirement mediation, |
| 64 bool include_passwords, | 66 bool include_passwords, |
| 65 const std::vector<GURL>& request_federations); | 67 const std::vector<GURL>& request_federations); |
| 66 ~CredentialManagerPendingRequestTask() override; | 68 ~CredentialManagerPendingRequestTask() override; |
| 67 | 69 |
| 68 SendCredentialCallback send_callback() const { return send_callback_; } | 70 SendCredentialCallback send_callback() const { return send_callback_; } |
| 69 const GURL& origin() const { return origin_; } | 71 const GURL& origin() const { return origin_; } |
| 70 | 72 |
| 71 // PasswordStoreConsumer: | 73 // PasswordStoreConsumer: |
| 72 void OnGetPasswordStoreResults( | 74 void OnGetPasswordStoreResults( |
| 73 std::vector<std::unique_ptr<autofill::PasswordForm>> results) override; | 75 std::vector<std::unique_ptr<autofill::PasswordForm>> results) override; |
| 74 | 76 |
| 75 private: | 77 private: |
| 76 // HttpPasswordStoreMigrator::Consumer: | 78 // HttpPasswordStoreMigrator::Consumer: |
| 77 void ProcessMigratedForms( | 79 void ProcessMigratedForms( |
| 78 std::vector<std::unique_ptr<autofill::PasswordForm>> forms) override; | 80 std::vector<std::unique_ptr<autofill::PasswordForm>> forms) override; |
| 79 | 81 |
| 80 void ProcessForms( | 82 void ProcessForms( |
| 81 std::vector<std::unique_ptr<autofill::PasswordForm>> results); | 83 std::vector<std::unique_ptr<autofill::PasswordForm>> results); |
| 82 | 84 |
| 83 CredentialManagerPendingRequestTaskDelegate* delegate_; // Weak; | 85 CredentialManagerPendingRequestTaskDelegate* delegate_; // Weak; |
| 84 SendCredentialCallback send_callback_; | 86 SendCredentialCallback send_callback_; |
| 85 const bool zero_click_only_; | 87 const CredentialMediationRequirement mediation_; |
| 86 const GURL origin_; | 88 const GURL origin_; |
| 87 const bool include_passwords_; | 89 const bool include_passwords_; |
| 88 std::set<std::string> federations_; | 90 std::set<std::string> federations_; |
| 89 | 91 |
| 90 std::unique_ptr<HttpPasswordStoreMigrator> http_migrator_; | 92 std::unique_ptr<HttpPasswordStoreMigrator> http_migrator_; |
| 91 | 93 |
| 92 DISALLOW_COPY_AND_ASSIGN(CredentialManagerPendingRequestTask); | 94 DISALLOW_COPY_AND_ASSIGN(CredentialManagerPendingRequestTask); |
| 93 }; | 95 }; |
| 94 | 96 |
| 95 } // namespace password_manager | 97 } // namespace password_manager |
| 96 | 98 |
| 97 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_R
EQUEST_TASK_H_ | 99 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_R
EQUEST_TASK_H_ |
| OLD | NEW |