Commit 0ba01dff authored by Jared Saul's avatar Jared Saul Committed by Commit Bot

[Autofill cleanup] Fix function ordering in AutofillClient and its subclasses

The broken ordering of functions between AutofillClient and its five
subclasses has gotten out of hand.  This CL cleans them all up and makes
them consistent with each other (and between their own .h and .cc files)
so that we can keep them consistent as we move forward in this area.

This CL purely moves lines around, with the exception of one deleted
function prototype in chrome_autofill_client.h that I explicitly call
out.

This CL is diffbased on
https://chromium-review.googlesource.com/c/chromium/src/+/1351256.

Change-Id: I250600d555c064691d6c50fbd414ec85956fc6e7
Reviewed-on: https://chromium-review.googlesource.com/c/1352449Reviewed-by: default avatarTao Bai <michaelbai@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarFabio Tirelo <ftirelo@chromium.org>
Commit-Queue: Jared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#612838}
parent f778f842
...@@ -64,8 +64,8 @@ class AwAutofillClient : public autofill::AutofillClient, ...@@ -64,8 +64,8 @@ class AwAutofillClient : public autofill::AutofillClient,
PrefService* GetPrefs() override; PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override; syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override; identity::IdentityManager* GetIdentityManager() override;
autofill::payments::PaymentsClient* GetPaymentsClient() override;
autofill::FormDataImporter* GetFormDataImporter() override; autofill::FormDataImporter* GetFormDataImporter() override;
autofill::payments::PaymentsClient* GetPaymentsClient() override;
autofill::LegacyStrikeDatabase* GetLegacyStrikeDatabase() override; autofill::LegacyStrikeDatabase* GetLegacyStrikeDatabase() override;
ukm::UkmRecorder* GetUkmRecorder() override; ukm::UkmRecorder* GetUkmRecorder() override;
ukm::SourceId GetUkmSourceId() override; ukm::SourceId GetUkmSourceId() override;
...@@ -79,8 +79,6 @@ class AwAutofillClient : public autofill::AutofillClient, ...@@ -79,8 +79,6 @@ class AwAutofillClient : public autofill::AutofillClient,
void OnUnmaskVerificationResult(PaymentsRpcResult result) override; void OnUnmaskVerificationResult(PaymentsRpcResult result) override;
void ShowLocalCardMigrationDialog( void ShowLocalCardMigrationDialog(
base::OnceClosure show_migration_dialog_closure) override; base::OnceClosure show_migration_dialog_closure) override;
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
void ConfirmMigrateLocalCardToCloud( void ConfirmMigrateLocalCardToCloud(
std::unique_ptr<base::DictionaryValue> legal_message, std::unique_ptr<base::DictionaryValue> legal_message,
const std::vector<autofill::MigratableCreditCard>& const std::vector<autofill::MigratableCreditCard>&
...@@ -95,6 +93,8 @@ class AwAutofillClient : public autofill::AutofillClient, ...@@ -95,6 +93,8 @@ class AwAutofillClient : public autofill::AutofillClient,
void ConfirmSaveCreditCardLocally(const autofill::CreditCard& card, void ConfirmSaveCreditCardLocally(const autofill::CreditCard& card,
bool show_prompt, bool show_prompt,
base::OnceClosure callback) override; base::OnceClosure callback) override;
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
void ConfirmSaveCreditCardToCloud( void ConfirmSaveCreditCardToCloud(
const autofill::CreditCard& card, const autofill::CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message, std::unique_ptr<base::DictionaryValue> legal_message,
...@@ -104,8 +104,6 @@ class AwAutofillClient : public autofill::AutofillClient, ...@@ -104,8 +104,6 @@ class AwAutofillClient : public autofill::AutofillClient,
UserAcceptedUploadCallback callback) override; UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const autofill::CreditCard& card, void ConfirmCreditCardFillAssist(const autofill::CreditCard& card,
base::OnceClosure callback) override; base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override; bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override; void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup( void ShowAutofillPopup(
...@@ -130,6 +128,10 @@ class AwAutofillClient : public autofill::AutofillClient, ...@@ -130,6 +128,10 @@ class AwAutofillClient : public autofill::AutofillClient,
bool AreServerCardsSupported() override; bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override; void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
void Dismissed(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); void Dismissed(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
void SuggestionSelected(JNIEnv* env, void SuggestionSelected(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj, const base::android::JavaParamRef<jobject>& obj,
......
...@@ -86,39 +86,6 @@ ...@@ -86,39 +86,6 @@
namespace autofill { namespace autofill {
ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
payments_client_(std::make_unique<payments::PaymentsClient>(
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->GetURLLoaderFactory(),
GetPrefs(),
GetIdentityManager(),
GetPersonalDataManager(),
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->IsOffTheRecord())),
form_data_importer_(std::make_unique<FormDataImporter>(
this,
payments_client_.get(),
GetPersonalDataManager(),
GetPersonalDataManager()->app_locale())),
unmask_controller_(
user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()),
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->IsOffTheRecord()) {
#if !defined(OS_ANDROID)
// Since ZoomController is also a WebContentsObserver, we need to be careful
// about disconnecting from it since the relative order of destruction of
// WebContentsObservers is not guaranteed. ZoomController silently clears
// its ZoomObserver list during WebContentsDestroyed() so there's no need
// to explicitly remove ourselves on destruction.
zoom::ZoomController* zoom_controller =
zoom::ZoomController::FromWebContents(web_contents);
// There may not always be a ZoomController, e.g. in tests.
if (zoom_controller)
zoom_controller->AddObserver(this);
#endif
}
ChromeAutofillClient::~ChromeAutofillClient() { ChromeAutofillClient::~ChromeAutofillClient() {
// NOTE: It is too late to clean up the autofill popup; that cleanup process // NOTE: It is too late to clean up the autofill popup; that cleanup process
// requires that the WebContents instance still be valid and it is not at // requires that the WebContents instance still be valid and it is not at
...@@ -162,14 +129,14 @@ identity::IdentityManager* ChromeAutofillClient::GetIdentityManager() { ...@@ -162,14 +129,14 @@ identity::IdentityManager* ChromeAutofillClient::GetIdentityManager() {
return IdentityManagerFactory::GetForProfile(profile->GetOriginalProfile()); return IdentityManagerFactory::GetForProfile(profile->GetOriginalProfile());
} }
payments::PaymentsClient* ChromeAutofillClient::GetPaymentsClient() {
return payments_client_.get();
}
FormDataImporter* ChromeAutofillClient::GetFormDataImporter() { FormDataImporter* ChromeAutofillClient::GetFormDataImporter() {
return form_data_importer_.get(); return form_data_importer_.get();
} }
payments::PaymentsClient* ChromeAutofillClient::GetPaymentsClient() {
return payments_client_.get();
}
LegacyStrikeDatabase* ChromeAutofillClient::GetLegacyStrikeDatabase() { LegacyStrikeDatabase* ChromeAutofillClient::GetLegacyStrikeDatabase() {
Profile* profile = Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext()); Profile::FromBrowserContext(web_contents()->GetBrowserContext());
...@@ -381,11 +348,6 @@ void ChromeAutofillClient::ConfirmCreditCardFillAssist( ...@@ -381,11 +348,6 @@ void ChromeAutofillClient::ConfirmCreditCardFillAssist(
#endif #endif
} }
void ChromeAutofillClient::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
::autofill::LoadRiskData(0, web_contents(), std::move(callback));
}
bool ChromeAutofillClient::HasCreditCardScanFeature() { bool ChromeAutofillClient::HasCreditCardScanFeature() {
return CreditCardScannerController::HasCreditCardScanFeature(); return CreditCardScannerController::HasCreditCardScanFeature();
} }
...@@ -441,36 +403,6 @@ bool ChromeAutofillClient::IsAutocompleteEnabled() { ...@@ -441,36 +403,6 @@ bool ChromeAutofillClient::IsAutocompleteEnabled() {
return prefs::IsAutocompleteEnabled(GetPrefs()); return prefs::IsAutocompleteEnabled(GetPrefs());
} }
bool ChromeAutofillClient::AreServerCardsSupported() {
// When in VR, server side cards are not supported.
return !vr::VrTabHelper::IsInVr(web_contents());
}
void ChromeAutofillClient::MainFrameWasResized(bool width_changed) {
#if defined(OS_ANDROID)
// Ignore virtual keyboard showing and hiding a strip of suggestions.
if (!width_changed)
return;
#endif
HideAutofillPopup();
}
void ChromeAutofillClient::WebContentsDestroyed() {
HideAutofillPopup();
}
void ChromeAutofillClient::DidAttachInterstitialPage() {
HideAutofillPopup();
}
#if !defined(OS_ANDROID)
void ChromeAutofillClient::OnZoomChanged(
const zoom::ZoomController::ZoomChangedEventData& data) {
HideAutofillPopup();
}
#endif // !defined(OS_ANDROID)
void ChromeAutofillClient::PropagateAutofillPredictions( void ChromeAutofillClient::PropagateAutofillPredictions(
content::RenderFrameHost* rfh, content::RenderFrameHost* rfh,
const std::vector<autofill::FormStructure*>& forms) { const std::vector<autofill::FormStructure*>& forms) {
...@@ -528,6 +460,11 @@ bool ChromeAutofillClient::ShouldShowSigninPromo() { ...@@ -528,6 +460,11 @@ bool ChromeAutofillClient::ShouldShowSigninPromo() {
#endif #endif
} }
bool ChromeAutofillClient::AreServerCardsSupported() {
// When in VR, server side cards are not supported.
return !vr::VrTabHelper::IsInVr(web_contents());
}
void ChromeAutofillClient::ExecuteCommand(int id) { void ChromeAutofillClient::ExecuteCommand(int id) {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
if (id == autofill::POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) { if (id == autofill::POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) {
...@@ -542,6 +479,69 @@ void ChromeAutofillClient::ExecuteCommand(int id) { ...@@ -542,6 +479,69 @@ void ChromeAutofillClient::ExecuteCommand(int id) {
#endif #endif
} }
void ChromeAutofillClient::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
::autofill::LoadRiskData(0, web_contents(), std::move(callback));
}
void ChromeAutofillClient::MainFrameWasResized(bool width_changed) {
#if defined(OS_ANDROID)
// Ignore virtual keyboard showing and hiding a strip of suggestions.
if (!width_changed)
return;
#endif
HideAutofillPopup();
}
void ChromeAutofillClient::WebContentsDestroyed() {
HideAutofillPopup();
}
void ChromeAutofillClient::DidAttachInterstitialPage() {
HideAutofillPopup();
}
#if !defined(OS_ANDROID)
void ChromeAutofillClient::OnZoomChanged(
const zoom::ZoomController::ZoomChangedEventData& data) {
HideAutofillPopup();
}
#endif // !defined(OS_ANDROID)
ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
payments_client_(std::make_unique<payments::PaymentsClient>(
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->GetURLLoaderFactory(),
GetPrefs(),
GetIdentityManager(),
GetPersonalDataManager(),
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->IsOffTheRecord())),
form_data_importer_(std::make_unique<FormDataImporter>(
this,
payments_client_.get(),
GetPersonalDataManager(),
GetPersonalDataManager()->app_locale())),
unmask_controller_(
user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()),
Profile::FromBrowserContext(web_contents->GetBrowserContext())
->IsOffTheRecord()) {
#if !defined(OS_ANDROID)
// Since ZoomController is also a WebContentsObserver, we need to be careful
// about disconnecting from it since the relative order of destruction of
// WebContentsObservers is not guaranteed. ZoomController silently clears
// its ZoomObserver list during WebContentsDestroyed() so there's no need
// to explicitly remove ourselves on destruction.
zoom::ZoomController* zoom_controller =
zoom::ZoomController::FromWebContents(web_contents);
// There may not always be a ZoomController, e.g. in tests.
if (zoom_controller)
zoom_controller->AddObserver(this);
#endif
}
Profile* ChromeAutofillClient::GetProfile() const { Profile* ChromeAutofillClient::GetProfile() const {
if (!web_contents()) if (!web_contents())
return nullptr; return nullptr;
......
...@@ -56,8 +56,8 @@ class ChromeAutofillClient ...@@ -56,8 +56,8 @@ class ChromeAutofillClient
PrefService* GetPrefs() override; PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override; syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override; identity::IdentityManager* GetIdentityManager() override;
payments::PaymentsClient* GetPaymentsClient() override;
FormDataImporter* GetFormDataImporter() override; FormDataImporter* GetFormDataImporter() override;
payments::PaymentsClient* GetPaymentsClient() override;
LegacyStrikeDatabase* GetLegacyStrikeDatabase() override; LegacyStrikeDatabase* GetLegacyStrikeDatabase() override;
ukm::UkmRecorder* GetUkmRecorder() override; ukm::UkmRecorder* GetUkmRecorder() override;
ukm::SourceId GetUkmSourceId() override; ukm::SourceId GetUkmSourceId() override;
...@@ -82,6 +82,10 @@ class ChromeAutofillClient ...@@ -82,6 +82,10 @@ class ChromeAutofillClient
void ConfirmSaveCreditCardLocally(const CreditCard& card, void ConfirmSaveCreditCardLocally(const CreditCard& card,
bool show_prompt, bool show_prompt,
base::OnceClosure callback) override; base::OnceClosure callback) override;
#if defined(OS_ANDROID)
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
#endif // defined(OS_ANDROID)
void ConfirmSaveCreditCardToCloud( void ConfirmSaveCreditCardToCloud(
const CreditCard& card, const CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message, std::unique_ptr<base::DictionaryValue> legal_message,
...@@ -89,15 +93,8 @@ class ChromeAutofillClient ...@@ -89,15 +93,8 @@ class ChromeAutofillClient
bool should_request_expiration_date_from_user, bool should_request_expiration_date_from_user,
bool show_prompt, bool show_prompt,
UserAcceptedUploadCallback callback) override; UserAcceptedUploadCallback callback) override;
#if defined(OS_ANDROID)
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
#endif // defined(OS_ANDROID)
void ConfirmCreditCardFillAssist(const CreditCard& card, void ConfirmCreditCardFillAssist(const CreditCard& card,
base::OnceClosure callback) override; base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override; bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override; void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup( void ShowAutofillPopup(
...@@ -122,6 +119,10 @@ class ChromeAutofillClient ...@@ -122,6 +119,10 @@ class ChromeAutofillClient
bool AreServerCardsSupported() override; bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override; void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
// content::WebContentsObserver implementation. // content::WebContentsObserver implementation.
void MainFrameWasResized(bool width_changed) override; void MainFrameWasResized(bool width_changed) override;
void WebContentsDestroyed() override; void WebContentsDestroyed() override;
...@@ -143,8 +144,6 @@ class ChromeAutofillClient ...@@ -143,8 +144,6 @@ class ChromeAutofillClient
explicit ChromeAutofillClient(content::WebContents* web_contents); explicit ChromeAutofillClient(content::WebContents* web_contents);
void ShowHttpNotSecureExplanation();
Profile* GetProfile() const; Profile* GetProfile() const;
base::string16 GetAccountHolderName(); base::string16 GetAccountHolderName();
......
...@@ -61,10 +61,6 @@ ukm::SourceId TestAutofillClient::GetUkmSourceId() { ...@@ -61,10 +61,6 @@ ukm::SourceId TestAutofillClient::GetUkmSourceId() {
return source_id_; return source_id_;
} }
void TestAutofillClient::InitializeUKMSources() {
UpdateSourceURL(GetUkmRecorder(), source_id_, form_origin_);
}
AddressNormalizer* TestAutofillClient::GetAddressNormalizer() { AddressNormalizer* TestAutofillClient::GetAddressNormalizer() {
return &test_address_normalizer_; return &test_address_normalizer_;
} }
...@@ -149,11 +145,6 @@ void TestAutofillClient::ConfirmCreditCardFillAssist( ...@@ -149,11 +145,6 @@ void TestAutofillClient::ConfirmCreditCardFillAssist(
std::move(callback).Run(); std::move(callback).Run();
} }
void TestAutofillClient::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
std::move(callback).Run("some risk data");
}
bool TestAutofillClient::HasCreditCardScanFeature() { bool TestAutofillClient::HasCreditCardScanFeature() {
return false; return false;
} }
...@@ -202,12 +193,21 @@ bool TestAutofillClient::ShouldShowSigninPromo() { ...@@ -202,12 +193,21 @@ bool TestAutofillClient::ShouldShowSigninPromo() {
return false; return false;
} }
void TestAutofillClient::ExecuteCommand(int id) {}
bool TestAutofillClient::AreServerCardsSupported() { bool TestAutofillClient::AreServerCardsSupported() {
return true; return true;
} }
void TestAutofillClient::ExecuteCommand(int id) {}
void TestAutofillClient::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
std::move(callback).Run("some risk data");
}
void TestAutofillClient::InitializeUKMSources() {
UpdateSourceURL(GetUkmRecorder(), source_id_, form_origin_);
}
void TestAutofillClient::set_form_origin(const GURL& url) { void TestAutofillClient::set_form_origin(const GURL& url) {
form_origin_ = url; form_origin_ = url;
// Also reset source_id_. // Also reset source_id_.
......
...@@ -31,7 +31,7 @@ class TestAutofillClient : public AutofillClient { ...@@ -31,7 +31,7 @@ class TestAutofillClient : public AutofillClient {
TestAutofillClient(); TestAutofillClient();
~TestAutofillClient() override; ~TestAutofillClient() override;
// AutofillClient implementation. // AutofillClient:
PersonalDataManager* GetPersonalDataManager() override; PersonalDataManager* GetPersonalDataManager() override;
scoped_refptr<AutofillWebDataService> GetDatabase() override; scoped_refptr<AutofillWebDataService> GetDatabase() override;
PrefService* GetPrefs() override; PrefService* GetPrefs() override;
...@@ -67,7 +67,6 @@ class TestAutofillClient : public AutofillClient { ...@@ -67,7 +67,6 @@ class TestAutofillClient : public AutofillClient {
void ConfirmAccountNameFixFlow( void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override; base::OnceCallback<void(const base::string16&)> callback) override;
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
void ConfirmSaveCreditCardToCloud( void ConfirmSaveCreditCardToCloud(
const CreditCard& card, const CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message, std::unique_ptr<base::DictionaryValue> legal_message,
...@@ -77,8 +76,6 @@ class TestAutofillClient : public AutofillClient { ...@@ -77,8 +76,6 @@ class TestAutofillClient : public AutofillClient {
UserAcceptedUploadCallback callback) override; UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const CreditCard& card, void ConfirmCreditCardFillAssist(const CreditCard& card,
base::OnceClosure callback) override; base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override; bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override; void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup( void ShowAutofillPopup(
...@@ -105,6 +102,11 @@ class TestAutofillClient : public AutofillClient { ...@@ -105,6 +102,11 @@ class TestAutofillClient : public AutofillClient {
bool ShouldShowSigninPromo() override; bool ShouldShowSigninPromo() override;
bool AreServerCardsSupported() override; bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override; void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
// Initializes UKM source from form_origin_. This needs to be called // Initializes UKM source from form_origin_. This needs to be called
// in unittests after calling Purge for ukm recorder to re-initialize // in unittests after calling Purge for ukm recorder to re-initialize
// sources. // sources.
......
...@@ -43,9 +43,10 @@ class ChromeAutofillClientIOS : public AutofillClient { ...@@ -43,9 +43,10 @@ class ChromeAutofillClientIOS : public AutofillClient {
// Sets a weak reference to the view controller used to present UI. // Sets a weak reference to the view controller used to present UI.
void SetBaseViewController(UIViewController* base_view_controller); void SetBaseViewController(UIViewController* base_view_controller);
// AutofillClientIOS implementation. // AutofillClient:
version_info::Channel GetChannel() const override; version_info::Channel GetChannel() const override;
PersonalDataManager* GetPersonalDataManager() override; PersonalDataManager* GetPersonalDataManager() override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
PrefService* GetPrefs() override; PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override; syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override; identity::IdentityManager* GetIdentityManager() override;
...@@ -84,8 +85,6 @@ class ChromeAutofillClientIOS : public AutofillClient { ...@@ -84,8 +85,6 @@ class ChromeAutofillClientIOS : public AutofillClient {
UserAcceptedUploadCallback callback) override; UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const CreditCard& card, void ConfirmCreditCardFillAssist(const CreditCard& card,
base::OnceClosure callback) override; base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override; bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override; void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup( void ShowAutofillPopup(
...@@ -94,23 +93,26 @@ class ChromeAutofillClientIOS : public AutofillClient { ...@@ -94,23 +93,26 @@ class ChromeAutofillClientIOS : public AutofillClient {
const std::vector<Suggestion>& suggestions, const std::vector<Suggestion>& suggestions,
bool /*unused_autoselect_first_suggestion*/, bool /*unused_autoselect_first_suggestion*/,
base::WeakPtr<AutofillPopupDelegate> delegate) override; base::WeakPtr<AutofillPopupDelegate> delegate) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void UpdateAutofillPopupDataListValues( void UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values, const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) override; const std::vector<base::string16>& labels) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void PropagateAutofillPredictions( void PropagateAutofillPredictions(
content::RenderFrameHost* rfh, content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) override; const std::vector<FormStructure*>& forms) override;
void DidFillOrPreviewField(const base::string16& autofilled_value, void DidFillOrPreviewField(const base::string16& autofilled_value,
const base::string16& profile_full_name) override; const base::string16& profile_full_name) override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
void DidInteractWithNonsecureCreditCardInput() override; void DidInteractWithNonsecureCreditCardInput() override;
bool IsContextSecure() override; bool IsContextSecure() override;
bool ShouldShowSigninPromo() override; bool ShouldShowSigninPromo() override;
bool AreServerCardsSupported() override; bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override; void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
private: private:
PrefService* pref_service_; PrefService* pref_service_;
syncer::SyncService* sync_service_; syncer::SyncService* sync_service_;
......
...@@ -114,6 +114,10 @@ PersonalDataManager* ChromeAutofillClientIOS::GetPersonalDataManager() { ...@@ -114,6 +114,10 @@ PersonalDataManager* ChromeAutofillClientIOS::GetPersonalDataManager() {
return personal_data_manager_; return personal_data_manager_;
} }
scoped_refptr<AutofillWebDataService> ChromeAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
PrefService* ChromeAutofillClientIOS::GetPrefs() { PrefService* ChromeAutofillClientIOS::GetPrefs() {
return pref_service_; return pref_service_;
} }
...@@ -188,6 +192,24 @@ void ChromeAutofillClientIOS::OnUnmaskVerificationResult( ...@@ -188,6 +192,24 @@ void ChromeAutofillClientIOS::OnUnmaskVerificationResult(
unmask_controller_.OnVerificationResult(result); unmask_controller_.OnVerificationResult(result);
} }
void ChromeAutofillClientIOS::ShowLocalCardMigrationDialog(
base::OnceClosure show_migration_dialog_closure) {
NOTIMPLEMENTED();
}
void ChromeAutofillClientIOS::ConfirmMigrateLocalCardToCloud(
std::unique_ptr<base::DictionaryValue> legal_message,
const std::vector<MigratableCreditCard>& migratable_credit_cards,
LocalCardMigrationCallback start_migrating_cards_callback) {
NOTIMPLEMENTED();
}
void ChromeAutofillClientIOS::ShowLocalCardMigrationResults(
const base::string16& tip_message,
const std::vector<MigratableCreditCard>& migratable_credit_cards) {
NOTIMPLEMENTED();
}
void ChromeAutofillClientIOS::ConfirmSaveAutofillProfile( void ChromeAutofillClientIOS::ConfirmSaveAutofillProfile(
const AutofillProfile& profile, const AutofillProfile& profile,
base::OnceClosure callback) { base::OnceClosure callback) {
...@@ -209,24 +231,6 @@ void ChromeAutofillClientIOS::ConfirmSaveCreditCardLocally( ...@@ -209,24 +231,6 @@ void ChromeAutofillClientIOS::ConfirmSaveCreditCardLocally(
/*local_save_card_callback=*/std::move(callback), GetPrefs()))); /*local_save_card_callback=*/std::move(callback), GetPrefs())));
} }
void ChromeAutofillClientIOS::ShowLocalCardMigrationDialog(
base::OnceClosure show_migration_dialog_closure) {
NOTIMPLEMENTED();
}
void ChromeAutofillClientIOS::ConfirmMigrateLocalCardToCloud(
std::unique_ptr<base::DictionaryValue> legal_message,
const std::vector<MigratableCreditCard>& migratable_credit_cards,
LocalCardMigrationCallback start_migrating_cards_callback) {
NOTIMPLEMENTED();
}
void ChromeAutofillClientIOS::ShowLocalCardMigrationResults(
const base::string16& tip_message,
const std::vector<MigratableCreditCard>& migratable_credit_cards) {
NOTIMPLEMENTED();
}
void ChromeAutofillClientIOS::ConfirmSaveCreditCardToCloud( void ChromeAutofillClientIOS::ConfirmSaveCreditCardToCloud(
const CreditCard& card, const CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message, std::unique_ptr<base::DictionaryValue> legal_message,
...@@ -262,11 +266,6 @@ void ChromeAutofillClientIOS::ConfirmCreditCardFillAssist( ...@@ -262,11 +266,6 @@ void ChromeAutofillClientIOS::ConfirmCreditCardFillAssist(
} }
} }
void ChromeAutofillClientIOS::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
std::move(callback).Run(ios::GetChromeBrowserProvider()->GetRiskData());
}
bool ChromeAutofillClientIOS::HasCreditCardScanFeature() { bool ChromeAutofillClientIOS::HasCreditCardScanFeature() {
return false; return false;
} }
...@@ -285,6 +284,12 @@ void ChromeAutofillClientIOS::ShowAutofillPopup( ...@@ -285,6 +284,12 @@ void ChromeAutofillClientIOS::ShowAutofillPopup(
[bridge_ showAutofillPopup:suggestions popupDelegate:delegate]; [bridge_ showAutofillPopup:suggestions popupDelegate:delegate];
} }
void ChromeAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void ChromeAutofillClientIOS::HideAutofillPopup() { void ChromeAutofillClientIOS::HideAutofillPopup() {
[bridge_ hideAutofillPopup]; [bridge_ hideAutofillPopup];
} }
...@@ -293,12 +298,6 @@ bool ChromeAutofillClientIOS::IsAutocompleteEnabled() { ...@@ -293,12 +298,6 @@ bool ChromeAutofillClientIOS::IsAutocompleteEnabled() {
return prefs::IsAutocompleteEnabled(GetPrefs()); return prefs::IsAutocompleteEnabled(GetPrefs());
} }
void ChromeAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void ChromeAutofillClientIOS::PropagateAutofillPredictions( void ChromeAutofillClientIOS::PropagateAutofillPredictions(
content::RenderFrameHost* rfh, content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) { const std::vector<FormStructure*>& forms) {
...@@ -311,10 +310,6 @@ void ChromeAutofillClientIOS::DidFillOrPreviewField( ...@@ -311,10 +310,6 @@ void ChromeAutofillClientIOS::DidFillOrPreviewField(
const base::string16& autofilled_value, const base::string16& autofilled_value,
const base::string16& profile_full_name) {} const base::string16& profile_full_name) {}
scoped_refptr<AutofillWebDataService> ChromeAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
void ChromeAutofillClientIOS::DidInteractWithNonsecureCreditCardInput() { void ChromeAutofillClientIOS::DidInteractWithNonsecureCreditCardInput() {
InsecureInputTabHelper::GetOrCreateForWebState(web_state_) InsecureInputTabHelper::GetOrCreateForWebState(web_state_)
->DidInteractWithNonsecureCreditCardInput(); ->DidInteractWithNonsecureCreditCardInput();
...@@ -328,12 +323,17 @@ bool ChromeAutofillClientIOS::ShouldShowSigninPromo() { ...@@ -328,12 +323,17 @@ bool ChromeAutofillClientIOS::ShouldShowSigninPromo() {
return false; return false;
} }
bool ChromeAutofillClientIOS::AreServerCardsSupported() {
return true;
}
void ChromeAutofillClientIOS::ExecuteCommand(int id) { void ChromeAutofillClientIOS::ExecuteCommand(int id) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
bool ChromeAutofillClientIOS::AreServerCardsSupported() { void ChromeAutofillClientIOS::LoadRiskData(
return true; base::OnceCallback<void(const std::string&)> callback) {
std::move(callback).Run(ios::GetChromeBrowserProvider()->GetRiskData());
} }
} // namespace autofill } // namespace autofill
...@@ -37,8 +37,9 @@ class WebViewAutofillClientIOS : public AutofillClient { ...@@ -37,8 +37,9 @@ class WebViewAutofillClientIOS : public AutofillClient {
syncer::SyncService* sync_service); syncer::SyncService* sync_service);
~WebViewAutofillClientIOS() override; ~WebViewAutofillClientIOS() override;
// AutofillClient implementation. // AutofillClient:
PersonalDataManager* GetPersonalDataManager() override; PersonalDataManager* GetPersonalDataManager() override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
PrefService* GetPrefs() override; PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override; syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override; identity::IdentityManager* GetIdentityManager() override;
...@@ -77,8 +78,6 @@ class WebViewAutofillClientIOS : public AutofillClient { ...@@ -77,8 +78,6 @@ class WebViewAutofillClientIOS : public AutofillClient {
UserAcceptedUploadCallback callback) override; UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const CreditCard& card, void ConfirmCreditCardFillAssist(const CreditCard& card,
base::OnceClosure callback) override; base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override; bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override; void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup( void ShowAutofillPopup(
...@@ -87,23 +86,26 @@ class WebViewAutofillClientIOS : public AutofillClient { ...@@ -87,23 +86,26 @@ class WebViewAutofillClientIOS : public AutofillClient {
const std::vector<Suggestion>& suggestions, const std::vector<Suggestion>& suggestions,
bool /*unused_autoselect_first_suggestion*/, bool /*unused_autoselect_first_suggestion*/,
base::WeakPtr<AutofillPopupDelegate> delegate) override; base::WeakPtr<AutofillPopupDelegate> delegate) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void UpdateAutofillPopupDataListValues( void UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values, const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) override; const std::vector<base::string16>& labels) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void PropagateAutofillPredictions( void PropagateAutofillPredictions(
content::RenderFrameHost* rfh, content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) override; const std::vector<FormStructure*>& forms) override;
void DidFillOrPreviewField(const base::string16& autofilled_value, void DidFillOrPreviewField(const base::string16& autofilled_value,
const base::string16& profile_full_name) override; const base::string16& profile_full_name) override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
void DidInteractWithNonsecureCreditCardInput() override; void DidInteractWithNonsecureCreditCardInput() override;
bool IsContextSecure() override; bool IsContextSecure() override;
bool ShouldShowSigninPromo() override; bool ShouldShowSigninPromo() override;
bool AreServerCardsSupported() override; bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override; void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
private: private:
PrefService* pref_service_; PrefService* pref_service_;
PersonalDataManager* personal_data_manager_; PersonalDataManager* personal_data_manager_;
......
...@@ -63,6 +63,10 @@ PersonalDataManager* WebViewAutofillClientIOS::GetPersonalDataManager() { ...@@ -63,6 +63,10 @@ PersonalDataManager* WebViewAutofillClientIOS::GetPersonalDataManager() {
return personal_data_manager_; return personal_data_manager_;
} }
scoped_refptr<AutofillWebDataService> WebViewAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
PrefService* WebViewAutofillClientIOS::GetPrefs() { PrefService* WebViewAutofillClientIOS::GetPrefs() {
return pref_service_; return pref_service_;
} }
...@@ -173,11 +177,6 @@ void WebViewAutofillClientIOS::ConfirmCreditCardFillAssist( ...@@ -173,11 +177,6 @@ void WebViewAutofillClientIOS::ConfirmCreditCardFillAssist(
const CreditCard& card, const CreditCard& card,
base::OnceClosure callback) {} base::OnceClosure callback) {}
void WebViewAutofillClientIOS::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
[bridge_ loadRiskData:std::move(callback)];
}
bool WebViewAutofillClientIOS::HasCreditCardScanFeature() { bool WebViewAutofillClientIOS::HasCreditCardScanFeature() {
return false; return false;
} }
...@@ -196,6 +195,12 @@ void WebViewAutofillClientIOS::ShowAutofillPopup( ...@@ -196,6 +195,12 @@ void WebViewAutofillClientIOS::ShowAutofillPopup(
[bridge_ showAutofillPopup:suggestions popupDelegate:delegate]; [bridge_ showAutofillPopup:suggestions popupDelegate:delegate];
} }
void WebViewAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void WebViewAutofillClientIOS::HideAutofillPopup() { void WebViewAutofillClientIOS::HideAutofillPopup() {
[bridge_ hideAutofillPopup]; [bridge_ hideAutofillPopup];
} }
...@@ -204,12 +209,6 @@ bool WebViewAutofillClientIOS::IsAutocompleteEnabled() { ...@@ -204,12 +209,6 @@ bool WebViewAutofillClientIOS::IsAutocompleteEnabled() {
return prefs::IsAutocompleteEnabled(GetPrefs()); return prefs::IsAutocompleteEnabled(GetPrefs());
} }
void WebViewAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void WebViewAutofillClientIOS::PropagateAutofillPredictions( void WebViewAutofillClientIOS::PropagateAutofillPredictions(
content::RenderFrameHost* rfh, content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) { const std::vector<FormStructure*>& forms) {
...@@ -220,10 +219,6 @@ void WebViewAutofillClientIOS::DidFillOrPreviewField( ...@@ -220,10 +219,6 @@ void WebViewAutofillClientIOS::DidFillOrPreviewField(
const base::string16& autofilled_value, const base::string16& autofilled_value,
const base::string16& profile_full_name) {} const base::string16& profile_full_name) {}
scoped_refptr<AutofillWebDataService> WebViewAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
void WebViewAutofillClientIOS::DidInteractWithNonsecureCreditCardInput() {} void WebViewAutofillClientIOS::DidInteractWithNonsecureCreditCardInput() {}
bool WebViewAutofillClientIOS::IsContextSecure() { bool WebViewAutofillClientIOS::IsContextSecure() {
...@@ -234,12 +229,17 @@ bool WebViewAutofillClientIOS::ShouldShowSigninPromo() { ...@@ -234,12 +229,17 @@ bool WebViewAutofillClientIOS::ShouldShowSigninPromo() {
return false; return false;
} }
bool WebViewAutofillClientIOS::AreServerCardsSupported() {
return true;
}
void WebViewAutofillClientIOS::ExecuteCommand(int id) { void WebViewAutofillClientIOS::ExecuteCommand(int id) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
bool WebViewAutofillClientIOS::AreServerCardsSupported() { void WebViewAutofillClientIOS::LoadRiskData(
return true; base::OnceCallback<void(const std::string&)> callback) {
[bridge_ loadRiskData:std::move(callback)];
} }
} // namespace autofill } // namespace autofill
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment