Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: ios/chrome/browser/passwords/credential_manager.mm

Issue 1866643002: Reland: Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/passwords/credential_manager.h ('k') | ipc/ipc_message_start.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/passwords/credential_manager.mm
diff --git a/ios/chrome/browser/passwords/credential_manager.mm b/ios/chrome/browser/passwords/credential_manager.mm
index b1e86fd1577e59f9cb4411ceb458010cc16f3555..1389ebae6a1c031178be02469f5f2de344634be5 100644
--- a/ios/chrome/browser/passwords/credential_manager.mm
+++ b/ios/chrome/browser/passwords/credential_manager.mm
@@ -117,7 +117,7 @@ void CredentialManager::CredentialsRequested(
// Invoked when the page invokes navigator.credentials.request(), this
// function will attempt to retrieve a Credential from the PasswordStore that
// meets the specified parameters and, if successful, send it back to the page
- // via SendCredential.
+ // via SendCredentialByID.
DCHECK_GE(request_id, 0);
password_manager::PasswordStore* store = GetPasswordStore();
@@ -139,7 +139,7 @@ void CredentialManager::CredentialsRequested(
// available, send back an empty credential.
if (zero_click_only && !IsZeroClickAllowed()) {
base::MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&CredentialManager::SendCredential,
+ FROM_HERE, base::Bind(&CredentialManager::SendCredentialByID,
weak_factory_.GetWeakPtr(), request_id,
password_manager::CredentialInfo()));
return;
@@ -161,8 +161,9 @@ void CredentialManager::CredentialsRequested(
std::vector<std::string> realms;
pending_request_.reset(
new password_manager::CredentialManagerPendingRequestTask(
- this, request_id, zero_click_only, page_url, true, federation_urls,
- realms));
+ this, base::Bind(&CredentialManager::SendCredentialByID,
+ base::Unretained(this), request_id),
+ zero_click_only, page_url, true, federation_urls, realms));
store->GetAutofillableLogins(pending_request_.get());
}
@@ -269,6 +270,12 @@ GURL CredentialManager::GetOrigin() const {
}
void CredentialManager::SendCredential(
+ const password_manager::SendCredentialCallback& send_callback,
+ const password_manager::CredentialInfo& credential) {
+ send_callback.Run(credential);
+}
+
+void CredentialManager::SendCredentialByID(
int request_id,
const password_manager::CredentialInfo& credential) {
// Invoked when the asynchronous interaction with the PasswordStore completes,
@@ -284,8 +291,9 @@ void CredentialManager::SendCredential(
}];
}
-void CredentialManager::SendPasswordForm(int request_id,
- const autofill::PasswordForm* form) {
+void CredentialManager::SendPasswordForm(
+ const password_manager::SendCredentialCallback& send_callback,
+ const autofill::PasswordForm* form) {
password_manager::CredentialInfo info;
if (form) {
password_manager::CredentialType type_to_return =
@@ -295,7 +303,7 @@ void CredentialManager::SendPasswordForm(int request_id,
info = password_manager::CredentialInfo(*form, type_to_return);
// TODO(vasilii): update |skip_zero_click| in the store (crbug.com/594110).
}
- SendCredential(request_id, info);
+ SendCredential(send_callback, info);
}
password_manager::PasswordManagerClient* CredentialManager::client() const {
« no previous file with comments | « ios/chrome/browser/passwords/credential_manager.h ('k') | ipc/ipc_message_start.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698