Skip to content

Commit

Permalink
Rename CreditCardFIDOAuthenticator -> CreditCardFidoAuthenticator
Browse files Browse the repository at this point in the history
This brings the class name of CreditCardFidoAuthenticator in line
with the Google C++ naming rules for acronyms.

BUG=1404395

Change-Id: I5d5c609a12a5d159787e4e5d8f0f4decab396f5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4185301
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096459}
  • Loading branch information
pkotwicz authored and Chromium LUCI CQ committed Jan 24, 2023
1 parent 143104c commit 0d0e2e4
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 208 deletions.
Expand Up @@ -81,7 +81,7 @@ void AutofillMetricsBaseTest::SetUp() {
autofill_manager()
.GetCreditCardAccessManager()
->set_fido_authenticator_for_testing(
std::make_unique<TestCreditCardFIDOAuthenticator>(
std::make_unique<TestCreditCardFidoAuthenticator>(
autofill_driver_.get(), autofill_client_.get()));
#endif

Expand Down Expand Up @@ -134,8 +134,8 @@ void AutofillMetricsBaseTest::SetFidoEligibility(bool is_verifiable) {
CreditCardAccessManager* access_manager =
autofill_manager().GetCreditCardAccessManager();
#if !BUILDFLAG(IS_IOS)
static_cast<TestCreditCardFIDOAuthenticator*>(
access_manager->GetOrCreateFIDOAuthenticator())
static_cast<TestCreditCardFidoAuthenticator*>(
access_manager->GetOrCreateFidoAuthenticator())
->SetUserVerifiable(is_verifiable);
#endif
static_cast<payments::TestPaymentsClient*>(
Expand Down
Expand Up @@ -161,7 +161,7 @@ void CreditCardAccessManager::PrepareToFetchCreditCard() {
} else {
is_user_verifiable_called_timestamp_ = AutofillTickClock::NowTicks();

GetOrCreateFIDOAuthenticator()->IsUserVerifiable(base::BindOnce(
GetOrCreateFidoAuthenticator()->IsUserVerifiable(base::BindOnce(
&CreditCardAccessManager::GetUnmaskDetailsIfUserIsVerifiable,
weak_ptr_factory_.GetWeakPtr()));
}
Expand Down Expand Up @@ -222,7 +222,7 @@ void CreditCardAccessManager::OnDidGetUnmaskDetails(

#if !BUILDFLAG(IS_IOS)
opt_in_intention_ =
GetOrCreateFIDOAuthenticator()->GetUserOptInIntention(unmask_details);
GetOrCreateFidoAuthenticator()->GetUserOptInIntention(unmask_details);
#endif
ready_to_start_authentication_.Signal();

Expand Down Expand Up @@ -295,7 +295,7 @@ void CreditCardAccessManager::FetchCreditCard(
if (is_user_verifiable_.value_or(false)) {
autofill_metrics::LogUserPerceivedLatencyOnCardSelection(
autofill_metrics::PreflightCallEvent::kDidNotChooseMaskedCard,
GetOrCreateFIDOAuthenticator()->IsUserOptedIn());
GetOrCreateFidoAuthenticator()->IsUserOptedIn());
}
#endif
Reset();
Expand Down Expand Up @@ -328,8 +328,8 @@ void CreditCardAccessManager::FIDOAuthOptChange(bool opt_in) {
return;
}

GetOrCreateFIDOAuthenticator()->OptOut();
GetOrCreateFIDOAuthenticator()
GetOrCreateFidoAuthenticator()->OptOut();
GetOrCreateFidoAuthenticator()
->GetOrCreateFidoAuthenticationStrikeDatabase()
->AddStrikes(
FidoAuthenticationStrikeDatabase::kStrikesToAddWhenUserOptsOut);
Expand Down Expand Up @@ -471,7 +471,7 @@ void CreditCardAccessManager::Authenticate(
#else
// If |is_authentication_in_progress_| is false, it means the process has
// been cancelled via the verification pending dialog. Do not run
// CreditCardFIDOAuthenticator::Authenticate() in this case (should not
// CreditCardFidoAuthenticator::Authenticate() in this case (should not
// fall back to CVC auth either).
if (!is_authentication_in_progress_) {
Reset();
Expand All @@ -491,7 +491,7 @@ void CreditCardAccessManager::Authenticate(
fido_request_options =
std::move(unmask_details_.fido_request_options.value());
}
GetOrCreateFIDOAuthenticator()->Authenticate(
GetOrCreateFidoAuthenticator()->Authenticate(
card_.get(), weak_ptr_factory_.GetWeakPtr(),
std::move(fido_request_options), context_token);
#endif
Expand Down Expand Up @@ -545,11 +545,11 @@ void CreditCardAccessManager::Authenticate(
}

#if !BUILDFLAG(IS_IOS)
CreditCardFIDOAuthenticator*
CreditCardAccessManager::GetOrCreateFIDOAuthenticator() {
CreditCardFidoAuthenticator*
CreditCardAccessManager::GetOrCreateFidoAuthenticator() {
if (!fido_authenticator_)
fido_authenticator_ =
std::make_unique<CreditCardFIDOAuthenticator>(driver_, client_);
std::make_unique<CreditCardFidoAuthenticator>(driver_, client_);
return fido_authenticator_.get();
}
#endif
Expand Down Expand Up @@ -596,13 +596,13 @@ void CreditCardAccessManager::OnCVCAuthenticationComplete(

// Additionally authorizes the card with FIDO. It also delays the form
// filling.
GetOrCreateFIDOAuthenticator()->Authorize(weak_ptr_factory_.GetWeakPtr(),
GetOrCreateFidoAuthenticator()->Authorize(weak_ptr_factory_.GetWeakPtr(),
response.card_authorization_token,
request_options->Clone());
#endif
}
if (ShouldOfferFidoOptInDialog(response)) {
// CreditCardFIDOAuthenticator will handle enrollment completely.
// CreditCardFidoAuthenticator will handle enrollment completely.
ShowWebauthnOfferDialog(response.card_authorization_token);
}

Expand Down Expand Up @@ -633,7 +633,7 @@ bool CreditCardAccessManager::UserOptedInToFidoFromSettingsPageOnMobile()

#if !BUILDFLAG(IS_IOS)
void CreditCardAccessManager::OnFIDOAuthenticationComplete(
const CreditCardFIDOAuthenticator::FidoAuthenticationResponse& response) {
const CreditCardFidoAuthenticator::FidoAuthenticationResponse& response) {
#if BUILDFLAG(IS_ANDROID)
if (base::FeatureList::IsEnabled(
features::kAutofillEnableFIDOProgressDialog)) {
Expand Down Expand Up @@ -772,7 +772,7 @@ bool CreditCardAccessManager::IsUserOptedInToFidoAuth() {
return false;
#else
return is_user_verifiable_.value_or(false) &&
GetOrCreateFIDOAuthenticator()->IsUserOptedIn();
GetOrCreateFidoAuthenticator()->IsUserOptedIn();
#endif
}

Expand Down Expand Up @@ -814,7 +814,7 @@ bool CreditCardAccessManager::ShouldRespondImmediately(
bool CreditCardAccessManager::ShouldRegisterCardWithFido(
const CreditCardCVCAuthenticator::CVCAuthenticationResponse& response) {
// Card authorization token is required in order to call
// CreditCardFIDOAuthenticator::Authorize(), so if we do not have a card
// CreditCardFidoAuthenticator::Authorize(), so if we do not have a card
// authorization token populated we immediately return false.
if (response.card_authorization_token.empty())
return false;
Expand Down Expand Up @@ -861,7 +861,7 @@ bool CreditCardAccessManager::ShouldOfferFidoOptInDialog(

// If the strike limit was reached for the FIDO opt-in dialog, we should not
// offer it.
if (GetOrCreateFIDOAuthenticator()
if (GetOrCreateFidoAuthenticator()
->GetOrCreateFidoAuthenticationStrikeDatabase()
->ShouldBlockFeature()) {
return false;
Expand All @@ -876,7 +876,7 @@ bool CreditCardAccessManager::ShouldOfferFidoOptInDialog(
void CreditCardAccessManager::ShowWebauthnOfferDialog(
std::string card_authorization_token) {
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
GetOrCreateFIDOAuthenticator()->OnWebauthnOfferDialogRequested(
GetOrCreateFidoAuthenticator()->OnWebauthnOfferDialogRequested(
card_authorization_token);
client_->ShowWebauthnOfferDialog(
base::BindRepeating(&CreditCardAccessManager::HandleDialogUserResponse,
Expand All @@ -895,11 +895,11 @@ void CreditCardAccessManager::HandleDialogUserResponse(
WebauthnDialogCallbackType type) {
switch (type) {
case WebauthnDialogCallbackType::kOfferAccepted:
GetOrCreateFIDOAuthenticator()->OnWebauthnOfferDialogUserResponse(
GetOrCreateFidoAuthenticator()->OnWebauthnOfferDialogUserResponse(
/*did_accept=*/true);
break;
case WebauthnDialogCallbackType::kOfferCancelled:
GetOrCreateFIDOAuthenticator()->OnWebauthnOfferDialogUserResponse(
GetOrCreateFidoAuthenticator()->OnWebauthnOfferDialogUserResponse(
/*did_accept=*/false);
break;
case WebauthnDialogCallbackType::kVerificationCancelled:
Expand All @@ -909,11 +909,11 @@ void CreditCardAccessManager::HandleDialogUserResponse(
SignalCanFetchUnmaskDetails();
ready_to_start_authentication_.Reset();
unmask_details_request_in_progress_ = false;
GetOrCreateFIDOAuthenticator()->CancelVerification();
GetOrCreateFidoAuthenticator()->CancelVerification();

// Indicate that FIDO authentication was canceled, resulting in falling
// back to CVC auth.
CreditCardFIDOAuthenticator::FidoAuthenticationResponse response{
CreditCardFidoAuthenticator::FidoAuthenticationResponse response{
.did_succeed = false};
OnFIDOAuthenticationComplete(response);
break;
Expand Down Expand Up @@ -946,7 +946,7 @@ void CreditCardAccessManager::FetchMaskedServerCard() {
kPreflightCallReturnedBeforeCardChosen
: autofill_metrics::PreflightCallEvent::
kCardChosenBeforePreflightCallReturned,
GetOrCreateFIDOAuthenticator()->IsUserOptedIn());
GetOrCreateFidoAuthenticator()->IsUserOptedIn());
}
#endif

Expand Down
Expand Up @@ -88,7 +88,7 @@ struct CachedServerCardInfo {
// with Google Payments. Owned by BrowserAutofillManager.
class CreditCardAccessManager : public CreditCardCVCAuthenticator::Requester,
#if !BUILDFLAG(IS_IOS)
public CreditCardFIDOAuthenticator::Requester,
public CreditCardFidoAuthenticator::Requester,
#endif
public CreditCardOtpAuthenticator::Requester {
public:
Expand Down Expand Up @@ -158,7 +158,7 @@ class CreditCardAccessManager : public CreditCardCVCAuthenticator::Requester,
bool IsCardPresentInUnmaskedCache(const CreditCard& card) const;

#if !BUILDFLAG(IS_IOS)
CreditCardFIDOAuthenticator* GetOrCreateFIDOAuthenticator();
CreditCardFidoAuthenticator* GetOrCreateFidoAuthenticator();
#endif

// CreditCardCVCAuthenticator::Requester:
Expand Down Expand Up @@ -219,7 +219,7 @@ class CreditCardAccessManager : public CreditCardCVCAuthenticator::Requester,

#if !BUILDFLAG(IS_IOS)
void set_fido_authenticator_for_testing(
std::unique_ptr<CreditCardFIDOAuthenticator> fido_authenticator) {
std::unique_ptr<CreditCardFidoAuthenticator> fido_authenticator) {
fido_authenticator_ = std::move(fido_authenticator);
}
#endif
Expand All @@ -237,7 +237,7 @@ class CreditCardAccessManager : public CreditCardCVCAuthenticator::Requester,
// Returns whether or not unmasked card cache is empty. Exposed for testing.
bool UnmaskedCardCacheIsEmpty();

// Invoked from CreditCardFIDOAuthenticator::IsUserVerifiable().
// Invoked from CreditCardFidoAuthenticator::IsUserVerifiable().
// |is_user_verifiable| is set to true only if user has a verifying platform
// authenticator. e.g. Touch/Face ID, Windows Hello, Android fingerprint,
// etc., is available and enabled. If set to true, then an Unmask Details
Expand Down Expand Up @@ -267,9 +267,9 @@ class CreditCardAccessManager : public CreditCardCVCAuthenticator::Requester,
#endif

#if !BUILDFLAG(IS_IOS)
// CreditCardFIDOAuthenticator::Requester:
// CreditCardFidoAuthenticator::Requester:
void OnFIDOAuthenticationComplete(
const CreditCardFIDOAuthenticator::FidoAuthenticationResponse& response)
const CreditCardFidoAuthenticator::FidoAuthenticationResponse& response)
override;
void OnFidoAuthorizationComplete(bool did_succeed) override;
#endif
Expand Down Expand Up @@ -419,7 +419,7 @@ class CreditCardAccessManager : public CreditCardCVCAuthenticator::Requester,
absl::optional<base::TimeTicks> is_user_verifiable_called_timestamp_;

#if !BUILDFLAG(IS_IOS)
std::unique_ptr<CreditCardFIDOAuthenticator> fido_authenticator_;
std::unique_ptr<CreditCardFidoAuthenticator> fido_authenticator_;

// User opt in/out intention when local pref and payments mismatch.
UserOptInIntention opt_in_intention_ = UserOptInIntention::kUnspecified;
Expand Down

0 comments on commit 0d0e2e4

Please sign in to comment.