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

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

Issue 23495006: rAc: better Wallet error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 7 years, 4 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/account_chooser_model.cc
diff --git a/chrome/browser/ui/autofill/account_chooser_model.cc b/chrome/browser/ui/autofill/account_chooser_model.cc
index 3c3bcb010596f75eabcf6ffa67fa1d4acdbae093..8980c906a3de3ebdaa7e0a2d2d9bc617c9bf3627 100644
--- a/chrome/browser/ui/autofill/account_chooser_model.cc
+++ b/chrome/browser/ui/autofill/account_chooser_model.cc
@@ -34,6 +34,7 @@ AccountChooserModel::AccountChooserModel(
checked_item_(
prefs->GetBoolean(::prefs::kAutofillDialogPayWithoutWallet) ?
kAutofillItemId : kActiveWalletItemId),
+ had_wallet_error_(false),
metric_logger_(metric_logger),
dialog_type_(dialog_type) {
ReconstructMenuItems();
@@ -73,7 +74,7 @@ bool AccountChooserModel::IsCommandIdChecked(int command_id) const {
bool AccountChooserModel::IsCommandIdEnabled(int command_id) const {
// Currently, _any_ (non-sign-in) error disables _all_ Wallet accounts.
- if (command_id != kAutofillItemId && HadWalletError())
+ if (command_id != kAutofillItemId && had_wallet_error_)
return false;
return true;
@@ -108,17 +109,13 @@ void AccountChooserModel::ExecuteCommand(int command_id, int event_flags) {
delegate_->AccountChoiceChanged();
}
-void AccountChooserModel::SetHadWalletError(const base::string16& message) {
+void AccountChooserModel::SetHadWalletError() {
// Any non-sign-in error disables all Wallet accounts.
- wallet_error_message_ = message;
+ had_wallet_error_ = true;
ClearActiveWalletAccountName();
ExecuteCommand(kAutofillItemId, 0);
}
-bool AccountChooserModel::HadWalletError() const {
- return !wallet_error_message_.empty();
-}
-
void AccountChooserModel::SetHadWalletSigninError() {
ClearActiveWalletAccountName();
ExecuteCommand(kAutofillItemId, 0);
« no previous file with comments | « chrome/browser/ui/autofill/account_chooser_model.h ('k') | chrome/browser/ui/autofill/account_chooser_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698