Chromium Code Reviews| Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| index b122d2f547b07c4537d4f6d355cede5703b746ab..77b08d9ba71f37175b33012711c63710bfb750ea 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| @@ -733,13 +733,6 @@ void AutofillDialogControllerImpl::OnWalletOrSigninUpdate() { |
| initial_user_state_ = GetInitialUserState(); |
| } |
| -void AutofillDialogControllerImpl::OnWalletSigninError() { |
| - signin_helper_.reset(); |
| - account_chooser_model_.SetHadWalletSigninError(); |
| - GetWalletClient()->CancelRequests(); |
| - LogDialogLatencyToShow(); |
| -} |
| - |
| void AutofillDialogControllerImpl::EnsureLegalDocumentsText() { |
| if (!wallet_items_ || wallet_items_->legal_documents().empty()) |
| return; |
| @@ -1966,6 +1959,13 @@ void AutofillDialogControllerImpl::OpenTabWithUrl(const GURL& url) { |
| #endif |
| } |
| +void AutofillDialogControllerImpl::OnWalletSigninError() { |
| + signin_helper_.reset(); |
| + account_chooser_model_.SetHadWalletSigninError(); |
| + GetWalletClient()->CancelRequests(); |
| + LogDialogLatencyToShow(); |
| +} |
| + |
| void AutofillDialogControllerImpl::DisableWallet() { |
| signin_helper_.reset(); |
| wallet_items_.reset(); |
| @@ -2689,12 +2689,15 @@ void AutofillDialogControllerImpl::FinishSubmit() { |
| LogOnFinishSubmitMetrics(); |
| // On a successful submit, if the user manually selected "pay without wallet", |
| - // stop trying to pay with Wallet on future runs of the dialog. |
| - bool manually_selected_pay_without_wallet = |
| - !account_chooser_model_.WalletIsSelected() && |
| - !account_chooser_model_.had_wallet_error(); |
| - profile_->GetPrefs()->SetBoolean(::prefs::kAutofillDialogPayWithoutWallet, |
| - manually_selected_pay_without_wallet); |
|
Dan Beam
2013/05/31 00:21:55
don't we use this to determine if it's first run?
|
| + // stop trying to pay with Wallet on future runs of the dialog. On the other |
| + // hand, if there was an error that prevented the user from having the choice |
| + // of using Wallet, leave the pref alone. |
| + if (!account_chooser_model_.had_wallet_error() && |
| + !account_chooser_model_.active_wallet_account_name().empty()) { |
| + profile_->GetPrefs()->SetBoolean( |
| + ::prefs::kAutofillDialogPayWithoutWallet, |
| + !account_chooser_model_.WalletIsSelected()); |
| + } |
|
Dan Beam
2013/05/31 00:21:55
and ensure this pref is set to its current value h
Evan Stade
2013/05/31 02:47:33
it seems better to stop making this pref pull doub
Evan Stade
2013/05/31 03:12:29
filed https://code.google.com/p/chromium/issues/de
|
| switch (GetDialogType()) { |
| case DIALOG_TYPE_AUTOCHECKOUT: |