Index: components/password_manager/core/browser/credential_manager_pending_request_task.h |
diff --git a/components/password_manager/core/browser/credential_manager_pending_request_task.h b/components/password_manager/core/browser/credential_manager_pending_request_task.h |
index d69a3a3a1029b98b7acb3d481fd7b07b24164d32..0f0dde2faf8b081bd7450850250e6c76c5c75f8d 100644 |
--- a/components/password_manager/core/browser/credential_manager_pending_request_task.h |
+++ b/components/password_manager/core/browser/credential_manager_pending_request_task.h |
@@ -24,6 +24,9 @@ namespace password_manager { |
struct CredentialInfo; |
class PasswordManagerClient; |
+typedef base::Callback<void(const CredentialInfo& credential)> |
+ SendCredentialCallback; |
+ |
// Sends credentials retrieved from the PasswordStore to CredentialManager API |
// clients and retrieves embedder-dependent information. |
class CredentialManagerPendingRequestTaskDelegate { |
@@ -41,7 +44,8 @@ class CredentialManagerPendingRequestTaskDelegate { |
virtual PasswordManagerClient* client() const = 0; |
// Sends a credential to JavaScript. |
- virtual void SendCredential(int id, const CredentialInfo& credential) = 0; |
+ virtual void SendCredential(const SendCredentialCallback& send_callback, |
+ const CredentialInfo& credential) = 0; |
}; |
// Retrieves credentials from the PasswordStore. |
@@ -49,7 +53,7 @@ class CredentialManagerPendingRequestTask : public PasswordStoreConsumer { |
public: |
CredentialManagerPendingRequestTask( |
CredentialManagerPendingRequestTaskDelegate* delegate, |
- int request_id, |
+ const SendCredentialCallback& callback, |
bool request_zero_click_only, |
const GURL& request_origin, |
bool include_passwords, |
@@ -57,7 +61,7 @@ class CredentialManagerPendingRequestTask : public PasswordStoreConsumer { |
const std::vector<std::string>& affiliated_realms); |
~CredentialManagerPendingRequestTask() override; |
- int id() const { return id_; } |
+ SendCredentialCallback send_callback() const { return send_callback_; } |
const GURL& origin() const { return origin_; } |
// PasswordStoreConsumer implementation. |
@@ -66,7 +70,7 @@ class CredentialManagerPendingRequestTask : public PasswordStoreConsumer { |
private: |
CredentialManagerPendingRequestTaskDelegate* delegate_; // Weak; |
- const int id_; |
+ SendCredentialCallback send_callback_; |
const bool zero_click_only_; |
const GURL origin_; |
const bool include_passwords_; |