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

Unified Diff: chrome/browser/autofill/wallet/wallet_items.cc

Issue 11777007: Adds wallet::RequiredAction for when we start interacting with Online Wallet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isherman@ review Created 7 years, 11 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/autofill/wallet/wallet_items.cc
diff --git a/chrome/browser/autofill/wallet/wallet_items.cc b/chrome/browser/autofill/wallet/wallet_items.cc
index 35307727e4a973c2efe45c09f52fabdeff12b966..a7568732dedb380c346afc5a14904104fb301887 100644
--- a/chrome/browser/autofill/wallet/wallet_items.cc
+++ b/chrome/browser/autofill/wallet/wallet_items.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/values.h"
+#include "chrome/browser/autofill/wallet/required_action.h"
namespace {
@@ -243,7 +244,7 @@ bool WalletItems::LegalDocument::operator!=(const LegalDocument& other) const {
return !(*this == other);
}
-WalletItems::WalletItems(const std::vector<std::string>& required_actions,
+WalletItems::WalletItems(const std::vector<RequiredAction>& required_actions,
const std::string& google_transaction_id,
const std::string& default_instrument_id,
const std::string& default_address_id)
@@ -262,13 +263,16 @@ scoped_ptr<WalletItems>
return scoped_ptr<WalletItems>();
}
- std::vector<std::string> required_action;
+ std::vector<RequiredAction> required_action;
const ListValue* required_action_list;
if (dictionary.GetList("required_action", &required_action_list)) {
for (size_t i = 0; i < required_action_list->GetSize(); ++i) {
- std::string action;
- if (required_action_list->GetString(i, &action))
- required_action.push_back(action);
+ std::string action_string;
+ if (required_action_list->GetString(i, &action_string)) {
+ RequiredAction action = ParseRequiredActionFromString(action_string);
+ if (ActionAppliesToWalletItems(action))
ahutter 2013/01/07 17:50:11 Ditto on throwing these out.
Dan Beam 2013/01/07 18:29:08 Done.
+ required_action.push_back(action);
+ }
}
} else {
DVLOG(1) << "Response from Google wallet missing required actions";
@@ -349,7 +353,7 @@ bool WalletItems::operator==(const WalletItems& other) const {
return google_transaction_id_ == other.google_transaction_id_ &&
default_instrument_id_ == other.default_instrument_id_ &&
default_address_id_ == other.default_address_id_ &&
- required_actions_ == required_actions_;
+ required_actions_ == other.required_actions_;
}
bool WalletItems::operator!=(const WalletItems& other) const {

Powered by Google App Engine
This is Rietveld 408576698