Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 15871004: Handle failed signin when setting kAutofillDialogPayWithoutWallet pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test i hope Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ // 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()) {
Dan Beam 2013/05/31 22:22:53 nit: account_chooser_model_.HasAccountsToChoose()
Evan Stade 2013/05/31 22:41:10 Done.
+ profile_->GetPrefs()->SetBoolean(
+ ::prefs::kAutofillDialogPayWithoutWallet,
+ !account_chooser_model_.WalletIsSelected());
+ }
switch (GetDialogType()) {
case DIALOG_TYPE_AUTOCHECKOUT:

Powered by Google App Engine
This is Rietveld 408576698