Commit c1dbfd39 authored by sandromaggi's avatar sandromaggi Committed by Commit Bot

[Autofill Assistant] Remove deprecated flag

It appears that this flag has lost its meaning. Removing
it.

Also unsubscribing from further PDM changes once the callback
is called.

Bug: b/168445878
Change-Id: I0222043e53070fde7a36ba507d6ed95b4d082d3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414395
Commit-Queue: Sandro Maggi <sandromaggi@google.com>
Reviewed-by: default avatarClemens Arbesser <arbesser@google.com>
Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808829}
parent 931ac59b
......@@ -513,7 +513,6 @@ void CollectUserDataAction::OnShowToUser(UserData* user_data,
// merge the new proto_ into the existing user_data. the proto_ always takes
// precedence over the existing user_data.
*field_change = UserData::FieldChange::ALL;
user_data->succeed_ = false;
auto collect_user_data = proto_.collect_user_data();
// the backend should explicitly set the terms and conditions state on every
// new action.
......@@ -565,7 +564,6 @@ void CollectUserDataAction::OnShowToUser(UserData* user_data,
// made implicitly, the entire UI will not be shown and the action will
// complete immediately.
if (OnlyLoginRequested(*collect_user_data_options_)) {
user_data->succeed_ = true;
std::move(collect_user_data_options_->confirm_callback)
.Run(user_data, nullptr);
return;
......@@ -617,16 +615,12 @@ void CollectUserDataAction::OnGetUserData(
const UserModel* user_model) {
if (!callback_)
return;
delegate_->GetPersonalDataManager()->RemoveObserver(this);
bool succeed = user_data->succeed_;
if (succeed) {
succeed = IsUserDataComplete(*user_data, *user_model,
*collect_user_data_options_);
WriteProcessedAction(user_data, user_model);
}
EndAction(succeed ? ClientStatus(ACTION_APPLIED)
: ClientStatus(COLLECT_USER_DATA_ERROR));
DCHECK(
IsUserDataComplete(*user_data, *user_model, *collect_user_data_options_));
EndAction(ClientStatus(ACTION_APPLIED));
}
void CollectUserDataAction::OnAdditionalActionTriggered(
......@@ -635,6 +629,7 @@ void CollectUserDataAction::OnAdditionalActionTriggered(
const UserModel* user_model) {
if (!callback_)
return;
delegate_->GetPersonalDataManager()->RemoveObserver(this);
processed_action_proto_->mutable_collect_user_data_result()
->set_additional_action_index(index);
......@@ -648,6 +643,7 @@ void CollectUserDataAction::OnTermsAndConditionsLinkClicked(
const UserModel* user_model) {
if (!callback_)
return;
delegate_->GetPersonalDataManager()->RemoveObserver(this);
processed_action_proto_->mutable_collect_user_data_result()->set_terms_link(
link);
......
......@@ -1255,11 +1255,6 @@ void Controller::OnCollectUserDataContinueButtonClicked() {
auto callback = std::move(collect_user_data_options_->confirm_callback);
// TODO(crbug.com/806868): succeed is currently always true, but we might want
// to set it to false and propagate the result to CollectUserDataAction
// when the user clicks "Cancel" during that action.
user_data_->succeed_ = true;
SetCollectUserDataOptions(nullptr);
std::move(callback).Run(user_data_.get(), &user_model_);
}
......
......@@ -108,7 +108,6 @@ class UserData {
AVAILABLE_PAYMENT_INSTRUMENTS,
};
bool succeed_ = false;
std::unique_ptr<autofill::CreditCard> selected_card_;
std::string login_choice_identifier_;
TermsAndConditionsState terms_and_conditions_ = NOT_SELECTED;
......
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