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

Unified Diff: chrome/browser/autofill/wallet/full_wallet.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/full_wallet.cc
diff --git a/chrome/browser/autofill/wallet/full_wallet.cc b/chrome/browser/autofill/wallet/full_wallet.cc
index a163cffa2d0d48ef4b1efe105386d7a640f6fee4..461c52ea8bd297f787113684cabe054a2ba14623 100644
--- a/chrome/browser/autofill/wallet/full_wallet.cc
+++ b/chrome/browser/autofill/wallet/full_wallet.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/values.h"
+#include "chrome/browser/autofill/wallet/required_action.h"
namespace {
@@ -24,7 +25,7 @@ FullWallet::FullWallet(int expiration_month,
const std::string& encrypted_rest,
scoped_ptr<Address> billing_address,
scoped_ptr<Address> shipping_address,
- const std::vector<std::string>& required_actions)
+ const std::vector<RequiredAction>& required_actions)
: expiration_month_(expiration_month),
expiration_year_(expiration_year),
iin_(iin),
@@ -40,14 +41,17 @@ FullWallet::~FullWallet() {}
scoped_ptr<FullWallet>
FullWallet::CreateFullWallet(const DictionaryValue& dictionary) {
const ListValue* required_actions_list;
- std::vector<std::string> required_actions;
+ std::vector<RequiredAction> required_actions;
if (dictionary.GetList("required_action", &required_actions_list)) {
for (size_t i = 0; i < required_actions_list->GetSize(); ++i) {
- std::string action;
- if (required_actions_list->GetString(i, &action))
- required_actions.push_back(action);
+ std::string action_string;
+ if (required_actions_list->GetString(i, &action_string)) {
+ RequiredAction action = ParseRequiredActionFromString(action_string);
+ if (ActionAppliesToFullWallet(action))
ahutter 2013/01/07 17:50:11 Throwing these out probably isn't the right thing
Dan Beam 2013/01/07 18:29:08 Done.
+ required_actions.push_back(action);
+ }
}
- if (required_actions.size() > 0)
+ if (required_actions.size() > 0) {
return scoped_ptr<FullWallet>(new FullWallet(-1,
-1,
"",
@@ -55,6 +59,7 @@ scoped_ptr<FullWallet>
scoped_ptr<Address>(),
scoped_ptr<Address>(),
required_actions));
+ }
} else {
DVLOG(1) << "Response from Google wallet missing required actions";
}

Powered by Google App Engine
This is Rietveld 408576698