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

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: class -> namespace 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..5aabdc15ffa2278df527c62ff86e22b1d8ba7290 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 = ParseFromString(action_string);
+ if (AppliesToWalletItems(action))
+ 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_;
Dan Beam 2013/01/05 03:53:47 I definitely said "whoopsies" out loud when I saw
Ilya Sherman 2013/01/05 23:30:49 Lol, oh my.
Dan Beam 2013/01/07 06:21:27 I suppose I can add a test for this before landing
Dan Beam 2013/01/07 15:44:53 Done.
}
bool WalletItems::operator!=(const WalletItems& other) const {

Powered by Google App Engine
This is Rietveld 408576698