diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-29 10:46:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-02 12:02:10 +0000 |
commit | 99677208ff3b216fdfec551fbe548da5520cd6fb (patch) | |
tree | 476a4865c10320249360e859d8fdd3e01833b03a /chromium/content/browser/devtools/protocol/webauthn_handler.cc | |
parent | c30a6232df03e1efbd9f3b226777b07e087a1122 (diff) | |
download | qtwebengine-chromium-99677208ff3b216fdfec551fbe548da5520cd6fb.tar.gz |
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/browser/devtools/protocol/webauthn_handler.cc')
-rw-r--r-- | chromium/content/browser/devtools/protocol/webauthn_handler.cc | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/chromium/content/browser/devtools/protocol/webauthn_handler.cc b/chromium/content/browser/devtools/protocol/webauthn_handler.cc index 0a543df15d4..02210825e90 100644 --- a/chromium/content/browser/devtools/protocol/webauthn_handler.cc +++ b/chromium/content/browser/devtools/protocol/webauthn_handler.cc @@ -109,9 +109,6 @@ Response WebAuthnHandler::Enable() { AuthenticatorEnvironmentImpl::GetInstance()->EnableVirtualAuthenticatorFor( frame_host_->frame_tree_node()); - virtual_discovery_factory_ = - AuthenticatorEnvironmentImpl::GetInstance()->GetVirtualFactoryFor( - frame_host_->frame_tree_node()); return Response::Success(); } @@ -120,14 +117,16 @@ Response WebAuthnHandler::Disable() { AuthenticatorEnvironmentImpl::GetInstance()->DisableVirtualAuthenticatorFor( frame_host_->frame_tree_node()); } - virtual_discovery_factory_ = nullptr; return Response::Success(); } Response WebAuthnHandler::AddVirtualAuthenticator( std::unique_ptr<WebAuthn::VirtualAuthenticatorOptions> options, String* out_authenticator_id) { - if (!virtual_discovery_factory_) + VirtualAuthenticatorManagerImpl* authenticator_manager = + AuthenticatorEnvironmentImpl::GetInstance() + ->MaybeGetVirtualAuthenticatorManager(frame_host_->frame_tree_node()); + if (!authenticator_manager) return Response::ServerError(kVirtualEnvironmentNotEnabled); auto transport = @@ -144,7 +143,7 @@ Response WebAuthnHandler::AddVirtualAuthenticator( return Response::InvalidParams(kCableNotSupportedOnU2f); } - auto* authenticator = virtual_discovery_factory_->CreateAuthenticator( + auto* authenticator = authenticator_manager->CreateAuthenticator( protocol, *transport, transport == device::FidoTransportProtocol::kInternal ? device::AuthenticatorAttachment::kPlatform @@ -165,10 +164,13 @@ Response WebAuthnHandler::AddVirtualAuthenticator( Response WebAuthnHandler::RemoveVirtualAuthenticator( const String& authenticator_id) { - if (!virtual_discovery_factory_) + VirtualAuthenticatorManagerImpl* authenticator_manager = + AuthenticatorEnvironmentImpl::GetInstance() + ->MaybeGetVirtualAuthenticatorManager(frame_host_->frame_tree_node()); + if (!authenticator_manager) return Response::ServerError(kVirtualEnvironmentNotEnabled); - if (!virtual_discovery_factory_->RemoveAuthenticator(authenticator_id)) + if (!authenticator_manager->RemoveAuthenticator(authenticator_id)) return Response::InvalidParams(kAuthenticatorNotFound); return Response::Success(); @@ -288,14 +290,29 @@ Response WebAuthnHandler::SetUserVerified(const String& authenticator_id, return Response::Success(); } +Response WebAuthnHandler::SetAutomaticPresenceSimulation( + const String& authenticator_id, + bool enabled) { + VirtualAuthenticator* authenticator; + Response response = FindAuthenticator(authenticator_id, &authenticator); + if (!response.IsSuccess()) + return response; + + authenticator->SetUserPresence(enabled); + return Response::Success(); +} + Response WebAuthnHandler::FindAuthenticator( const String& id, VirtualAuthenticator** out_authenticator) { *out_authenticator = nullptr; - if (!virtual_discovery_factory_) + VirtualAuthenticatorManagerImpl* authenticator_manager = + AuthenticatorEnvironmentImpl::GetInstance() + ->MaybeGetVirtualAuthenticatorManager(frame_host_->frame_tree_node()); + if (!authenticator_manager) return Response::ServerError(kVirtualEnvironmentNotEnabled); - *out_authenticator = virtual_discovery_factory_->GetAuthenticator(id); + *out_authenticator = authenticator_manager->GetAuthenticator(id); if (!*out_authenticator) return Response::InvalidParams(kAuthenticatorNotFound); |