Commit d4a29e9f authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Remove AutofillClient::ConfirmSaveAutofillProfile

This API was planned to be used in ios/web_view, but plans have changed
and it is no longer necessary. There is no change in behavior.

Change-Id: Ie7de41895cbd4ed61a36a5e03b580975ba3ba58f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145675Reviewed-by: default avatarChristos Froussios <cfroussios@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760092}
parent 1ebbeb36
......@@ -141,14 +141,6 @@ void AwAutofillClient::ShowLocalCardMigrationResults(
NOTIMPLEMENTED();
}
void AwAutofillClient::ConfirmSaveAutofillProfile(
const autofill::AutofillProfile& profile,
base::OnceClosure callback) {
// Since there is no confirmation needed to save an Autofill Profile,
// running |callback| will proceed with saving |profile|.
std::move(callback).Run();
}
void AwAutofillClient::ConfirmSaveCreditCardLocally(
const autofill::CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -94,8 +94,6 @@ class AwAutofillClient : public autofill::AutofillClient,
const std::vector<autofill::MigratableCreditCard>&
migratable_credit_cards,
MigrationDeleteCardCallback delete_local_card_callback) override;
void ConfirmSaveAutofillProfile(const autofill::AutofillProfile& profile,
base::OnceClosure callback) override;
void ConfirmSaveCreditCardLocally(
const autofill::CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -363,14 +363,6 @@ void ChromeAutofillClient::OfferVirtualCardOptions(
}
#endif
void ChromeAutofillClient::ConfirmSaveAutofillProfile(
const AutofillProfile& profile,
base::OnceClosure callback) {
// Since there is no confirmation needed to save an Autofill Profile,
// running |callback| will proceed with saving |profile|.
std::move(callback).Run();
}
void ChromeAutofillClient::ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -108,8 +108,6 @@ class ChromeAutofillClient
const std::vector<CreditCard*>& candidates,
base::OnceCallback<void(const std::string&)> callback) override;
#endif // !defined(OS_ANDROID)
void ConfirmSaveAutofillProfile(const AutofillProfile& profile,
base::OnceClosure callback) override;
void ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -61,7 +61,6 @@ namespace autofill {
class AddressNormalizer;
class AutocompleteHistoryManager;
class AutofillPopupDelegate;
class AutofillProfile;
class CardUnmaskDelegate;
class CreditCard;
class FormDataImporter;
......@@ -354,10 +353,6 @@ class AutofillClient : public RiskDataLoader {
base::OnceCallback<void(const std::string&)> callback) = 0;
#endif
// Runs |callback| if the |profile| should be imported as personal data.
virtual void ConfirmSaveAutofillProfile(const AutofillProfile& profile,
base::OnceClosure callback) = 0;
// Runs |callback| once the user makes a decision with respect to the
// offer-to-save prompt. On desktop, shows the offer-to-save bubble if
// |options.show_prompt| is true; otherwise only shows the
......
......@@ -382,15 +382,9 @@ bool FormDataImporter::ImportAddressProfileForSection(
return false;
}
// Delaying |SaveImportedProfile| is safe here because PersonalDataManager
// outlives this class.
client_->ConfirmSaveAutofillProfile(
candidate_profile,
base::BindOnce(
base::IgnoreResult(&PersonalDataManager::SaveImportedProfile),
base::Unretained(personal_data_manager_), candidate_profile));
return true;
std::string guid =
personal_data_manager_->SaveImportedProfile(candidate_profile);
return !guid.empty();
}
bool FormDataImporter::ImportCreditCard(
......
......@@ -139,14 +139,6 @@ void TestAutofillClient::OfferVirtualCardOptions(
base::OnceCallback<void(const std::string&)> callback) {}
#endif
void TestAutofillClient::ConfirmSaveAutofillProfile(
const AutofillProfile& profile,
base::OnceClosure callback) {
// Since there is no confirmation needed to save an Autofill Profile,
// running |callback| will proceed with saving |profile|.
std::move(callback).Run();
}
void TestAutofillClient::ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -83,8 +83,6 @@ class TestAutofillClient : public AutofillClient {
const std::vector<CreditCard*>& candidates,
base::OnceCallback<void(const std::string&)> callback) override;
#endif
void ConfirmSaveAutofillProfile(const AutofillProfile& profile,
base::OnceClosure callback) override;
void ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......@@ -186,6 +184,10 @@ class TestAutofillClient : public AutofillClient {
}
#endif
void set_should_save_autofill_profiles(bool value) {
should_save_autofill_profiles_ = value;
}
bool ConfirmSaveCardLocallyWasCalled() {
return confirm_save_credit_card_locally_called_;
}
......@@ -230,6 +232,8 @@ class TestAutofillClient : public AutofillClient {
security_state::SecurityLevel security_level_ =
security_state::SecurityLevel::NONE;
bool should_save_autofill_profiles_ = true;
bool confirm_save_credit_card_locally_called_ = false;
// Populated if save was offered. True if bubble was shown, false otherwise.
......
......@@ -83,8 +83,6 @@ class ChromeAutofillClientIOS : public AutofillClient {
const base::string16& tip_message,
const std::vector<MigratableCreditCard>& migratable_credit_cards,
MigrationDeleteCardCallback delete_local_card_callback) override;
void ConfirmSaveAutofillProfile(const AutofillProfile& profile,
base::OnceClosure callback) override;
void ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -254,14 +254,6 @@ void ChromeAutofillClientIOS::ShowLocalCardMigrationResults(
NOTIMPLEMENTED();
}
void ChromeAutofillClientIOS::ConfirmSaveAutofillProfile(
const AutofillProfile& profile,
base::OnceClosure callback) {
// Since there is no confirmation needed to save an Autofill Profile,
// running |callback| will proceed with saving |profile|.
std::move(callback).Run();
}
void ChromeAutofillClientIOS::ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -75,8 +75,6 @@ class WebViewAutofillClientIOS : public AutofillClient {
const base::string16& tip_message,
const std::vector<MigratableCreditCard>& migratable_credit_cards,
MigrationDeleteCardCallback delete_local_card_callback) override;
void ConfirmSaveAutofillProfile(const AutofillProfile& profile,
base::OnceClosure callback) override;
void ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -184,12 +184,6 @@ void WebViewAutofillClientIOS::ShowLocalCardMigrationResults(
NOTIMPLEMENTED();
}
void WebViewAutofillClientIOS::ConfirmSaveAutofillProfile(
const AutofillProfile& profile,
base::OnceClosure callback) {
[bridge_ confirmSaveAutofillProfile:profile callback:std::move(callback)];
}
void WebViewAutofillClientIOS::ConfirmSaveCreditCardLocally(
const CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -157,12 +157,6 @@ void AutofillClientImpl::OfferVirtualCardOptions(
}
#endif
void AutofillClientImpl::ConfirmSaveAutofillProfile(
const autofill::AutofillProfile& profile,
base::OnceClosure callback) {
NOTREACHED();
}
void AutofillClientImpl::ConfirmSaveCreditCardLocally(
const autofill::CreditCard& card,
SaveCreditCardOptions options,
......
......@@ -78,8 +78,6 @@ class AutofillClientImpl
base::OnceCallback<void(const std::string&)> callback) override;
#endif
void ConfirmSaveAutofillProfile(const autofill::AutofillProfile& profile,
base::OnceClosure callback) override;
void ConfirmSaveCreditCardLocally(
const autofill::CreditCard& card,
SaveCreditCardOptions options,
......
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