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,
PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override;
autofill::payments::PaymentsClient* GetPaymentsClient() override;
autofill::FormDataImporter* GetFormDataImporter() override;
autofill::payments::PaymentsClient* GetPaymentsClient() override;
autofill::LegacyStrikeDatabase* GetLegacyStrikeDatabase() override;
ukm::UkmRecorder* GetUkmRecorder() override;
ukm::SourceId GetUkmSourceId() override;
......@@ -79,8 +79,6 @@ class AwAutofillClient : public autofill::AutofillClient,
void OnUnmaskVerificationResult(PaymentsRpcResult result) override;
void ShowLocalCardMigrationDialog(
base::OnceClosure show_migration_dialog_closure) override;
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
void ConfirmMigrateLocalCardToCloud(
std::unique_ptr<base::DictionaryValue> legal_message,
const std::vector<autofill::MigratableCreditCard>&
......@@ -95,6 +93,8 @@ class AwAutofillClient : public autofill::AutofillClient,
void ConfirmSaveCreditCardLocally(const autofill::CreditCard& card,
bool show_prompt,
base::OnceClosure callback) override;
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
void ConfirmSaveCreditCardToCloud(
const autofill::CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message,
......@@ -104,8 +104,6 @@ class AwAutofillClient : public autofill::AutofillClient,
UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const autofill::CreditCard& card,
base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup(
......@@ -130,6 +128,10 @@ class AwAutofillClient : public autofill::AutofillClient,
bool AreServerCardsSupported() 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 SuggestionSelected(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
......
......@@ -86,39 +86,6 @@
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() {
// 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
......@@ -162,14 +129,14 @@ identity::IdentityManager* ChromeAutofillClient::GetIdentityManager() {
return IdentityManagerFactory::GetForProfile(profile->GetOriginalProfile());
}
payments::PaymentsClient* ChromeAutofillClient::GetPaymentsClient() {
return payments_client_.get();
}
FormDataImporter* ChromeAutofillClient::GetFormDataImporter() {
return form_data_importer_.get();
}
payments::PaymentsClient* ChromeAutofillClient::GetPaymentsClient() {
return payments_client_.get();
}
LegacyStrikeDatabase* ChromeAutofillClient::GetLegacyStrikeDatabase() {
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
......@@ -381,11 +348,6 @@ void ChromeAutofillClient::ConfirmCreditCardFillAssist(
#endif
}
void ChromeAutofillClient::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
::autofill::LoadRiskData(0, web_contents(), std::move(callback));
}
bool ChromeAutofillClient::HasCreditCardScanFeature() {
return CreditCardScannerController::HasCreditCardScanFeature();
}
......@@ -441,36 +403,6 @@ bool ChromeAutofillClient::IsAutocompleteEnabled() {
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(
content::RenderFrameHost* rfh,
const std::vector<autofill::FormStructure*>& forms) {
......@@ -528,6 +460,11 @@ bool ChromeAutofillClient::ShouldShowSigninPromo() {
#endif
}
bool ChromeAutofillClient::AreServerCardsSupported() {
// When in VR, server side cards are not supported.
return !vr::VrTabHelper::IsInVr(web_contents());
}
void ChromeAutofillClient::ExecuteCommand(int id) {
#if defined(OS_ANDROID)
if (id == autofill::POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) {
......@@ -542,6 +479,69 @@ void ChromeAutofillClient::ExecuteCommand(int id) {
#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 {
if (!web_contents())
return nullptr;
......
......@@ -56,8 +56,8 @@ class ChromeAutofillClient
PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override;
payments::PaymentsClient* GetPaymentsClient() override;
FormDataImporter* GetFormDataImporter() override;
payments::PaymentsClient* GetPaymentsClient() override;
LegacyStrikeDatabase* GetLegacyStrikeDatabase() override;
ukm::UkmRecorder* GetUkmRecorder() override;
ukm::SourceId GetUkmSourceId() override;
......@@ -82,6 +82,10 @@ class ChromeAutofillClient
void ConfirmSaveCreditCardLocally(const CreditCard& card,
bool show_prompt,
base::OnceClosure callback) override;
#if defined(OS_ANDROID)
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
#endif // defined(OS_ANDROID)
void ConfirmSaveCreditCardToCloud(
const CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message,
......@@ -89,15 +93,8 @@ class ChromeAutofillClient
bool should_request_expiration_date_from_user,
bool show_prompt,
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,
base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup(
......@@ -122,6 +119,10 @@ class ChromeAutofillClient
bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
// content::WebContentsObserver implementation.
void MainFrameWasResized(bool width_changed) override;
void WebContentsDestroyed() override;
......@@ -143,8 +144,6 @@ class ChromeAutofillClient
explicit ChromeAutofillClient(content::WebContents* web_contents);
void ShowHttpNotSecureExplanation();
Profile* GetProfile() const;
base::string16 GetAccountHolderName();
......
......@@ -61,10 +61,6 @@ ukm::SourceId TestAutofillClient::GetUkmSourceId() {
return source_id_;
}
void TestAutofillClient::InitializeUKMSources() {
UpdateSourceURL(GetUkmRecorder(), source_id_, form_origin_);
}
AddressNormalizer* TestAutofillClient::GetAddressNormalizer() {
return &test_address_normalizer_;
}
......@@ -149,11 +145,6 @@ void TestAutofillClient::ConfirmCreditCardFillAssist(
std::move(callback).Run();
}
void TestAutofillClient::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
std::move(callback).Run("some risk data");
}
bool TestAutofillClient::HasCreditCardScanFeature() {
return false;
}
......@@ -202,12 +193,21 @@ bool TestAutofillClient::ShouldShowSigninPromo() {
return false;
}
void TestAutofillClient::ExecuteCommand(int id) {}
bool TestAutofillClient::AreServerCardsSupported() {
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) {
form_origin_ = url;
// Also reset source_id_.
......
......@@ -31,7 +31,7 @@ class TestAutofillClient : public AutofillClient {
TestAutofillClient();
~TestAutofillClient() override;
// AutofillClient implementation.
// AutofillClient:
PersonalDataManager* GetPersonalDataManager() override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
PrefService* GetPrefs() override;
......@@ -67,7 +67,6 @@ class TestAutofillClient : public AutofillClient {
void ConfirmAccountNameFixFlow(
base::OnceCallback<void(const base::string16&)> callback) override;
#endif // defined(OS_ANDROID)
void ConfirmSaveCreditCardToCloud(
const CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message,
......@@ -77,8 +76,6 @@ class TestAutofillClient : public AutofillClient {
UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const CreditCard& card,
base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup(
......@@ -105,6 +102,11 @@ class TestAutofillClient : public AutofillClient {
bool ShouldShowSigninPromo() override;
bool AreServerCardsSupported() 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
// in unittests after calling Purge for ukm recorder to re-initialize
// sources.
......
......@@ -43,9 +43,10 @@ class ChromeAutofillClientIOS : public AutofillClient {
// Sets a weak reference to the view controller used to present UI.
void SetBaseViewController(UIViewController* base_view_controller);
// AutofillClientIOS implementation.
// AutofillClient:
version_info::Channel GetChannel() const override;
PersonalDataManager* GetPersonalDataManager() override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override;
......@@ -84,8 +85,6 @@ class ChromeAutofillClientIOS : public AutofillClient {
UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const CreditCard& card,
base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup(
......@@ -94,23 +93,26 @@ class ChromeAutofillClientIOS : public AutofillClient {
const std::vector<Suggestion>& suggestions,
bool /*unused_autoselect_first_suggestion*/,
base::WeakPtr<AutofillPopupDelegate> delegate) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void PropagateAutofillPredictions(
content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) override;
void DidFillOrPreviewField(const base::string16& autofilled_value,
const base::string16& profile_full_name) override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
void DidInteractWithNonsecureCreditCardInput() override;
bool IsContextSecure() override;
bool ShouldShowSigninPromo() override;
bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
private:
PrefService* pref_service_;
syncer::SyncService* sync_service_;
......
......@@ -114,6 +114,10 @@ PersonalDataManager* ChromeAutofillClientIOS::GetPersonalDataManager() {
return personal_data_manager_;
}
scoped_refptr<AutofillWebDataService> ChromeAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
PrefService* ChromeAutofillClientIOS::GetPrefs() {
return pref_service_;
}
......@@ -188,6 +192,24 @@ void ChromeAutofillClientIOS::OnUnmaskVerificationResult(
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(
const AutofillProfile& profile,
base::OnceClosure callback) {
......@@ -209,24 +231,6 @@ void ChromeAutofillClientIOS::ConfirmSaveCreditCardLocally(
/*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(
const CreditCard& card,
std::unique_ptr<base::DictionaryValue> legal_message,
......@@ -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() {
return false;
}
......@@ -285,6 +284,12 @@ void ChromeAutofillClientIOS::ShowAutofillPopup(
[bridge_ showAutofillPopup:suggestions popupDelegate:delegate];
}
void ChromeAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void ChromeAutofillClientIOS::HideAutofillPopup() {
[bridge_ hideAutofillPopup];
}
......@@ -293,12 +298,6 @@ bool ChromeAutofillClientIOS::IsAutocompleteEnabled() {
return prefs::IsAutocompleteEnabled(GetPrefs());
}
void ChromeAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void ChromeAutofillClientIOS::PropagateAutofillPredictions(
content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) {
......@@ -311,10 +310,6 @@ void ChromeAutofillClientIOS::DidFillOrPreviewField(
const base::string16& autofilled_value,
const base::string16& profile_full_name) {}
scoped_refptr<AutofillWebDataService> ChromeAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
void ChromeAutofillClientIOS::DidInteractWithNonsecureCreditCardInput() {
InsecureInputTabHelper::GetOrCreateForWebState(web_state_)
->DidInteractWithNonsecureCreditCardInput();
......@@ -328,12 +323,17 @@ bool ChromeAutofillClientIOS::ShouldShowSigninPromo() {
return false;
}
bool ChromeAutofillClientIOS::AreServerCardsSupported() {
return true;
}
void ChromeAutofillClientIOS::ExecuteCommand(int id) {
NOTIMPLEMENTED();
}
bool ChromeAutofillClientIOS::AreServerCardsSupported() {
return true;
void ChromeAutofillClientIOS::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
std::move(callback).Run(ios::GetChromeBrowserProvider()->GetRiskData());
}
} // namespace autofill
......@@ -37,8 +37,9 @@ class WebViewAutofillClientIOS : public AutofillClient {
syncer::SyncService* sync_service);
~WebViewAutofillClientIOS() override;
// AutofillClient implementation.
// AutofillClient:
PersonalDataManager* GetPersonalDataManager() override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
PrefService* GetPrefs() override;
syncer::SyncService* GetSyncService() override;
identity::IdentityManager* GetIdentityManager() override;
......@@ -77,8 +78,6 @@ class WebViewAutofillClientIOS : public AutofillClient {
UserAcceptedUploadCallback callback) override;
void ConfirmCreditCardFillAssist(const CreditCard& card,
base::OnceClosure callback) override;
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
bool HasCreditCardScanFeature() override;
void ScanCreditCard(const CreditCardScanCallback& callback) override;
void ShowAutofillPopup(
......@@ -87,23 +86,26 @@ class WebViewAutofillClientIOS : public AutofillClient {
const std::vector<Suggestion>& suggestions,
bool /*unused_autoselect_first_suggestion*/,
base::WeakPtr<AutofillPopupDelegate> delegate) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) override;
void HideAutofillPopup() override;
bool IsAutocompleteEnabled() override;
void PropagateAutofillPredictions(
content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) override;
void DidFillOrPreviewField(const base::string16& autofilled_value,
const base::string16& profile_full_name) override;
scoped_refptr<AutofillWebDataService> GetDatabase() override;
void DidInteractWithNonsecureCreditCardInput() override;
bool IsContextSecure() override;
bool ShouldShowSigninPromo() override;
bool AreServerCardsSupported() override;
void ExecuteCommand(int id) override;
// RiskDataLoader:
void LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) override;
private:
PrefService* pref_service_;
PersonalDataManager* personal_data_manager_;
......
......@@ -63,6 +63,10 @@ PersonalDataManager* WebViewAutofillClientIOS::GetPersonalDataManager() {
return personal_data_manager_;
}
scoped_refptr<AutofillWebDataService> WebViewAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
PrefService* WebViewAutofillClientIOS::GetPrefs() {
return pref_service_;
}
......@@ -173,11 +177,6 @@ void WebViewAutofillClientIOS::ConfirmCreditCardFillAssist(
const CreditCard& card,
base::OnceClosure callback) {}
void WebViewAutofillClientIOS::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
[bridge_ loadRiskData:std::move(callback)];
}
bool WebViewAutofillClientIOS::HasCreditCardScanFeature() {
return false;
}
......@@ -196,6 +195,12 @@ void WebViewAutofillClientIOS::ShowAutofillPopup(
[bridge_ showAutofillPopup:suggestions popupDelegate:delegate];
}
void WebViewAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void WebViewAutofillClientIOS::HideAutofillPopup() {
[bridge_ hideAutofillPopup];
}
......@@ -204,12 +209,6 @@ bool WebViewAutofillClientIOS::IsAutocompleteEnabled() {
return prefs::IsAutocompleteEnabled(GetPrefs());
}
void WebViewAutofillClientIOS::UpdateAutofillPopupDataListValues(
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
NOTREACHED();
}
void WebViewAutofillClientIOS::PropagateAutofillPredictions(
content::RenderFrameHost* rfh,
const std::vector<FormStructure*>& forms) {
......@@ -220,10 +219,6 @@ void WebViewAutofillClientIOS::DidFillOrPreviewField(
const base::string16& autofilled_value,
const base::string16& profile_full_name) {}
scoped_refptr<AutofillWebDataService> WebViewAutofillClientIOS::GetDatabase() {
return autofill_web_data_service_;
}
void WebViewAutofillClientIOS::DidInteractWithNonsecureCreditCardInput() {}
bool WebViewAutofillClientIOS::IsContextSecure() {
......@@ -234,12 +229,17 @@ bool WebViewAutofillClientIOS::ShouldShowSigninPromo() {
return false;
}
bool WebViewAutofillClientIOS::AreServerCardsSupported() {
return true;
}
void WebViewAutofillClientIOS::ExecuteCommand(int id) {
NOTIMPLEMENTED();
}
bool WebViewAutofillClientIOS::AreServerCardsSupported() {
return true;
void WebViewAutofillClientIOS::LoadRiskData(
base::OnceCallback<void(const std::string&)> callback) {
[bridge_ loadRiskData:std::move(callback)];
}
} // 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