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

Unified Diff: components/password_manager/content/renderer/credential_manager_client.cc

Issue 2864493003: Deprecate CredentialRequestOptions.unmediated in favor mediation enum (Closed)
Patch Set: Rebase Created 3 years, 7 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
Index: components/password_manager/content/renderer/credential_manager_client.cc
diff --git a/components/password_manager/content/renderer/credential_manager_client.cc b/components/password_manager/content/renderer/credential_manager_client.cc
index b859abb11859a130e354b560bcc63cee96a08783..b310d0921bec2b8c23ab4cecf76f2d1813da9a69 100644
--- a/components/password_manager/content/renderer/credential_manager_client.cc
+++ b/components/password_manager/content/renderer/credential_manager_client.cc
@@ -65,6 +65,21 @@ std::unique_ptr<blink::WebCredential> CredentialInfoToWebCredential(
return nullptr;
}
+CredentialMediationRequirement GetCredentialMediationRequirementFromBlink(
+ blink::WebCredentialMediationRequirement mediation) {
+ switch (mediation) {
+ case blink::WebCredentialMediationRequirement::kSilent:
+ return CredentialMediationRequirement::kSilent;
+ case blink::WebCredentialMediationRequirement::kOptional:
+ return CredentialMediationRequirement::kOptional;
+ case blink::WebCredentialMediationRequirement::kRequired:
+ return CredentialMediationRequirement::kRequired;
+ }
+
+ NOTREACHED();
+ return CredentialMediationRequirement::kOptional;
+}
+
blink::WebCredentialManagerError GetWebCredentialManagerErrorFromMojo(
mojom::CredentialManagerError error) {
switch (error) {
@@ -227,7 +242,7 @@ void CredentialManagerClient::DispatchRequireUserMediation(
}
void CredentialManagerClient::DispatchGet(
- bool zero_click_only,
+ blink::WebCredentialMediationRequirement mediation,
bool include_passwords,
const blink::WebVector<blink::WebURL>& federations,
RequestCallbacks* callbacks) {
@@ -239,7 +254,8 @@ void CredentialManagerClient::DispatchGet(
federation_vector.push_back(federations[i]);
mojo_cm_service_->Get(
- zero_click_only, include_passwords, federation_vector,
+ GetCredentialMediationRequirementFromBlink(mediation), include_passwords,
+ federation_vector,
base::Bind(&RespondToRequestCallback,
base::Owned(new RequestCallbacksWrapper(callbacks))));
}

Powered by Google App Engine
This is Rietveld 408576698