Index: chrome/browser/autofill/wallet/wallet_client.cc |
diff --git a/chrome/browser/autofill/wallet/wallet_client.cc b/chrome/browser/autofill/wallet/wallet_client.cc |
index 27e1f475d65ca296594641a788ea59f4f71b3228..af67575662219baabfc88c46f96f7711d1bfa8b5 100644 |
--- a/chrome/browser/autofill/wallet/wallet_client.cc |
+++ b/chrome/browser/autofill/wallet/wallet_client.cc |
@@ -25,6 +25,7 @@ |
namespace { |
const char kEncryptOtpBodyFormat[] = "cvv=%s:%s"; |
+const char kEscrowSensitiveInformationFormat[] = "gid=%s&cardNumber=%s&cvv=%s"; |
const char kJsonMimeType[] = "application/json"; |
const char kApplicationMimeType[] = "application/x-www-form-urlencoded"; |
const size_t kMaxBits = 63; |
@@ -75,9 +76,30 @@ void WalletClient::EncryptOtp( |
base::HexEncode(&num_bits, 1).c_str(), |
base::HexEncode(otp, length).c_str()); |
- MakeWalletRequest(GetSecureUrl(), post_body, observer, kApplicationMimeType); |
+ MakeWalletRequest(GetEncryptionUrl(), |
+ post_body, |
+ observer, |
+ kApplicationMimeType); |
} |
+void WalletClient::EscrowSensitiveInformation( |
+ const std::string& pan, |
+ const std::string& cvn, |
+ const std::string& obfuscated_gaia_id, |
+ WalletClient::WalletClientObserver* observer) { |
+ DCHECK_EQ(request_type_, NO_PENDING_REQUEST); |
Ilya Sherman
2013/01/09 23:30:48
nit: Swap the argument order. To see why, try cha
ahutter
2013/01/10 00:24:46
Done.
|
+ |
Ilya Sherman
2013/01/09 23:30:48
Optional nit: Omit this empty line IMO
ahutter
2013/01/10 00:24:46
Done.
|
+ request_type_ = ESCROW_SENSITIVE_INFORMATION; |
+ |
+ std::string post_body = StringPrintf(kEscrowSensitiveInformationFormat, |
+ obfuscated_gaia_id.c_str(), |
+ pan.c_str(), |
+ cvn.c_str()); |
+ |
+ MakeWalletRequest(GetEscrowUrl(), post_body, observer, kApplicationMimeType); |
+} |
+ |
+ |
void WalletClient::GetFullWallet( |
const std::string& instrument_id, |
const std::string& address_id, |
@@ -240,6 +262,13 @@ void WalletClient::OnURLFetchComplete( |
} |
break; |
} |
+ case ESCROW_SENSITIVE_INFORMATION: { |
+ if (!data.empty()) |
+ observer_->OnEscrowSensitiveInformation(data); |
+ else |
+ observer_->OnWalletError(); |
+ break; |
+ } |
Ilya Sherman
2013/01/09 23:30:48
nit: No need for curly braces.
ahutter
2013/01/10 00:24:46
They're there for consistency but I can drop them
Ilya Sherman
2013/01/10 00:35:40
I don't think they're needed for any of the cases.
|
case GET_FULL_WALLET: { |
if (response_dict.get()) { |
scoped_ptr<FullWallet> full_wallet( |