summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahutter@chromium.org <ahutter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-04 05:53:55 +0000
committerahutter@chromium.org <ahutter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-04 05:53:55 +0000
commit61a5a81d54b382fc8a244d98c2b5857cc1eeec4d (patch)
treef98fbe0d983034e369fe7a0cccf2ff73e366d40e
parente8dad9bc446a8a1f51fe9cba4c3dda7e8297379f (diff)
downloadchromium_src-61a5a81d54b382fc8a244d98c2b5857cc1eeec4d.zip
chromium_src-61a5a81d54b382fc8a244d98c2b5857cc1eeec4d.tar.gz
chromium_src-61a5a81d54b382fc8a244d98c2b5857cc1eeec4d.tar.bz2
Carts are deprecated by the latest version of the server
BUG= 240333 Review URL: https://chromiumcodereview.appspot.com/14836006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203852 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc12
-rw-r--r--chrome/chrome_tests_unit.gypi1
-rw-r--r--components/autofill.gypi2
-rw-r--r--components/autofill/browser/wallet/cart.cc25
-rw-r--r--components/autofill/browser/wallet/cart.h50
-rw-r--r--components/autofill/browser/wallet/cart_unittest.cc21
-rw-r--r--components/autofill/browser/wallet/wallet_client.cc5
-rw-r--r--components/autofill/browser/wallet/wallet_client.h5
-rw-r--r--components/autofill/browser/wallet/wallet_client_unittest.cc21
9 files changed, 0 insertions, 142 deletions
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index 61e156c..c338047 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -42,7 +42,6 @@
#include "components/autofill/browser/risk/fingerprint.h"
#include "components/autofill/browser/risk/proto/fingerprint.pb.h"
#include "components/autofill/browser/validation.h"
-#include "components/autofill/browser/wallet/cart.h"
#include "components/autofill/browser/wallet/full_wallet.h"
#include "components/autofill/browser/wallet/instrument.h"
#include "components/autofill/browser/wallet/wallet_address.h"
@@ -80,15 +79,6 @@ namespace {
const bool kPayWithoutWalletDefault = false;
-// This is a pseudo-scientifically chosen maximum amount we want a fronting
-// (proxy) card to be able to charge. The current actual max is $2000. Using
-// only $1850 leaves some room for tax and shipping, etc. TODO(dbeam): send a
-// special value to the server to just ask for the maximum so we don't need to
-// hardcode it here (http://crbug.com/180731). TODO(dbeam): also maybe allow
-// users to give us this number via an <input> (http://crbug.com/180733).
-const int kCartMax = 1850;
-const char kCartCurrency[] = "USD";
-
const char kAddNewItemKey[] = "add-new-item";
const char kManageItemsKey[] = "manage-items";
const char kSameAsBillingKey[] = "same-as-billing";
@@ -1727,7 +1717,6 @@ void AutofillDialogControllerImpl::OnDidGetWalletItems(
legal_document_link_ranges_.clear();
has_accepted_legal_documents_ = false;
- // TODO(dbeam): verify items support kCartCurrency? http://crbug.com/232952
wallet_items_ = wallet_items.Pass();
OnWalletOrSigninUpdate();
}
@@ -2650,7 +2639,6 @@ void AutofillDialogControllerImpl::GetFullWallet() {
active_instrument_id_,
active_address_id_,
source_url_,
- wallet::Cart(base::IntToString(kCartMax), kCartCurrency),
wallet_items_->google_transaction_id(),
capabilities));
}
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 355e5ff..13cb1d4 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -1772,7 +1772,6 @@
'../components/autofill/browser/phone_number_unittest.cc',
'../components/autofill/browser/phone_number_i18n_unittest.cc',
'../components/autofill/browser/validation_unittest.cc',
- '../components/autofill/browser/wallet/cart_unittest.cc',
'../components/autofill/browser/wallet/encryption_escrow_client_unittest.cc',
'../components/autofill/browser/wallet/full_wallet_unittest.cc',
'../components/autofill/browser/wallet/instrument_unittest.cc',
diff --git a/components/autofill.gypi b/components/autofill.gypi
index cc563f7..684543b 100644
--- a/components/autofill.gypi
+++ b/components/autofill.gypi
@@ -224,8 +224,6 @@
'autofill/browser/state_names.h',
'autofill/browser/validation.cc',
'autofill/browser/validation.h',
- 'autofill/browser/wallet/cart.cc',
- 'autofill/browser/wallet/cart.h',
'autofill/browser/wallet/encryption_escrow_client.cc',
'autofill/browser/wallet/encryption_escrow_client.h',
'autofill/browser/wallet/encryption_escrow_client_observer.h',
diff --git a/components/autofill/browser/wallet/cart.cc b/components/autofill/browser/wallet/cart.cc
deleted file mode 100644
index b6f41a4..0000000
--- a/components/autofill/browser/wallet/cart.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/autofill/browser/wallet/cart.h"
-
-#include "base/values.h"
-
-namespace autofill {
-namespace wallet {
-
-Cart::Cart(const std::string& total_price, const std::string& currency_code)
- : total_price_(total_price), currency_code_(currency_code) {}
-
-Cart::~Cart() {}
-
-scoped_ptr<base::DictionaryValue> Cart::ToDictionary() const {
- base::DictionaryValue* dict = new base::DictionaryValue();
- dict->SetString("total_price", total_price_);
- dict->SetString("currency_code", currency_code_);
- return scoped_ptr<base::DictionaryValue>(dict);
-}
-
-} // namespace wallet
-} // namespace autofill
diff --git a/components/autofill/browser/wallet/cart.h b/components/autofill/browser/wallet/cart.h
deleted file mode 100644
index fc106c1..0000000
--- a/components/autofill/browser/wallet/cart.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_CART_H_
-#define COMPONENTS_AUTOFILL_BROWSER_WALLET_CART_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-
-namespace base {
-class DictionaryValue;
-}
-
-namespace autofill {
-namespace wallet {
-
-// Container object for purchase data provided by the browser. The enclosed data
-// is required to request a FullWallet from Online Wallet in order to set
-// spending limits on the generated proxy card. If the actual amount is not
-// available, the maximum allowable value should be used: $1850 USD. Online
-// Wallet is designed to accept price information in addition to information
-// about the items being purchased hence the name Cart.
-class Cart {
- public:
- Cart(const std::string& total_price, const std::string& currency_code);
- ~Cart();
-
- scoped_ptr<base::DictionaryValue> ToDictionary() const;
-
- const std::string& total_price() const { return total_price_; }
- const std::string& currency_code() const { return currency_code_; }
-
- private:
- // |total_price_| must be a formatted as a double with no more than two
- // decimals, e.g. 100.99
- std::string total_price_;
-
- // |currency_code_| must be one of the ISO 4217 currency codes, e.g. USD.
- std::string currency_code_;
-
- DISALLOW_ASSIGN(Cart);
-};
-
-} // namespace wallet
-} // namespace autofill
-
-#endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_CART_H_
diff --git a/components/autofill/browser/wallet/cart_unittest.cc b/components/autofill/browser/wallet/cart_unittest.cc
deleted file mode 100644
index ae84c1b..0000000
--- a/components/autofill/browser/wallet/cart_unittest.cc
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/values.h"
-#include "components/autofill/browser/wallet/cart.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace autofill {
-namespace wallet {
-
-TEST(Cart, ToDictionary) {
- base::DictionaryValue expected;
- expected.SetString("total_price", "total_price");
- expected.SetString("currency_code", "currency_code");
- Cart cart("total_price", "currency_code");
- ASSERT_TRUE(expected.Equals(cart.ToDictionary().get()));
-}
-
-} // namespace wallet
-} // namespace autofill
diff --git a/components/autofill/browser/wallet/wallet_client.cc b/components/autofill/browser/wallet/wallet_client.cc
index d1c0f34..f8cd755 100644
--- a/components/autofill/browser/wallet/wallet_client.cc
+++ b/components/autofill/browser/wallet/wallet_client.cc
@@ -178,7 +178,6 @@ AutofillMetrics::WalletRequiredActionMetric RequiredActionToUmaMetric(
const char kAcceptedLegalDocumentKey[] = "accepted_legal_document";
const char kApiKeyKey[] = "api_key";
const char kAuthResultKey[] = "auth_result";
-const char kCartKey[] = "cart";
const char kEncryptedOtpKey[] = "encrypted_otp";
const char kErrorTypeKey[] = "wallet_error.error_type";
const char kFeatureKey[] = "feature";
@@ -209,13 +208,11 @@ WalletClient::FullWalletRequest::FullWalletRequest(
const std::string& instrument_id,
const std::string& address_id,
const GURL& source_url,
- const Cart& cart,
const std::string& google_transaction_id,
const std::vector<RiskCapability> risk_capabilities)
: instrument_id(instrument_id),
address_id(address_id),
source_url(source_url),
- cart(cart),
google_transaction_id(google_transaction_id),
risk_capabilities(risk_capabilities) {}
@@ -306,8 +303,6 @@ void WalletClient::GetFullWallet(const FullWalletRequest& full_wallet_request) {
full_wallet_request.source_url.GetWithEmptyPath().spec());
pending_request_body_.SetString(kGoogleTransactionIdKey,
full_wallet_request.google_transaction_id);
- pending_request_body_.Set(kCartKey,
- full_wallet_request.cart.ToDictionary().release());
pending_request_body_.SetString(
kFeatureKey,
DialogTypeToFeatureString(delegate_->GetDialogType()));
diff --git a/components/autofill/browser/wallet/wallet_client.h b/components/autofill/browser/wallet/wallet_client.h
index 51f74ba..715e0cf 100644
--- a/components/autofill/browser/wallet/wallet_client.h
+++ b/components/autofill/browser/wallet/wallet_client.h
@@ -15,7 +15,6 @@
#include "base/values.h"
#include "components/autofill/browser/autofill_manager_delegate.h"
#include "components/autofill/browser/autofill_metrics.h"
-#include "components/autofill/browser/wallet/cart.h"
#include "components/autofill/browser/wallet/encryption_escrow_client.h"
#include "components/autofill/browser/wallet/encryption_escrow_client_observer.h"
#include "components/autofill/browser/wallet/full_wallet.h"
@@ -102,7 +101,6 @@ class WalletClient
FullWalletRequest(const std::string& instrument_id,
const std::string& address_id,
const GURL& source_url,
- const Cart& cart,
const std::string& google_transaction_id,
const std::vector<RiskCapability> risk_capabilities);
~FullWalletRequest();
@@ -118,9 +116,6 @@ class WalletClient
// The URL that Online Wallet usage is being initiated on.
GURL source_url;
- // Cart information.
- Cart cart;
-
// The transaction ID from GetWalletItems.
std::string google_transaction_id;
diff --git a/components/autofill/browser/wallet/wallet_client_unittest.cc b/components/autofill/browser/wallet/wallet_client_unittest.cc
index dd5244c..825ea04 100644
--- a/components/autofill/browser/wallet/wallet_client_unittest.cc
+++ b/components/autofill/browser/wallet/wallet_client_unittest.cc
@@ -11,7 +11,6 @@
#include "base/values.h"
#include "chrome/test/base/testing_profile.h"
#include "components/autofill/browser/autofill_metrics.h"
-#include "components/autofill/browser/wallet/cart.h"
#include "components/autofill/browser/wallet/full_wallet.h"
#include "components/autofill/browser/wallet/instrument.h"
#include "components/autofill/browser/wallet/wallet_client.h"
@@ -294,11 +293,6 @@ const char kAuthenticateInstrumentValidRequest[] =
const char kGetFullWalletValidRequest[] =
"{"
- "\"cart\":"
- "{"
- "\"currency_code\":\"currency_code\","
- "\"total_price\":\"total_price\""
- "},"
"\"encrypted_otp\":\"encrypted_one_time_pad\","
"\"feature\":\"REQUEST_AUTOCOMPLETE\","
"\"google_transaction_id\":\"google_transaction_id\","
@@ -314,11 +308,6 @@ const char kGetFullWalletValidRequest[] =
const char kGetFullWalletWithRiskCapabilitesValidRequest[] =
"{"
- "\"cart\":"
- "{"
- "\"currency_code\":\"currency_code\","
- "\"total_price\":\"total_price\""
- "},"
"\"encrypted_otp\":\"encrypted_one_time_pad\","
"\"feature\":\"REQUEST_AUTOCOMPLETE\","
"\"google_transaction_id\":\"google_transaction_id\","
@@ -846,12 +835,10 @@ TEST_F(WalletClientTest, GetFullWalletSuccess) {
delegate_.ExpectLogWalletApiCallDuration(AutofillMetrics::GET_FULL_WALLET, 1);
delegate_.ExpectBaselineMetrics(HAS_ESCROW_REQUEST, HAS_WALLET_REQUEST);
- Cart cart("total_price", "currency_code");
WalletClient::FullWalletRequest full_wallet_request(
"instrument_id",
"shipping_address_id",
GURL(kMerchantUrl),
- cart,
"google_transaction_id",
std::vector<WalletClient::RiskCapability>());
wallet_client_->GetFullWallet(full_wallet_request);
@@ -871,12 +858,10 @@ TEST_F(WalletClientTest, GetFullWalletWithRiskCapabilitesSuccess) {
std::vector<WalletClient::RiskCapability> risk_capabilities;
risk_capabilities.push_back(WalletClient::VERIFY_CVC);
- Cart cart("total_price", "currency_code");
WalletClient::FullWalletRequest full_wallet_request(
"instrument_id",
"shipping_address_id",
GURL(kMerchantUrl),
- cart,
"google_transaction_id",
risk_capabilities);
wallet_client_->GetFullWallet(full_wallet_request);
@@ -897,12 +882,10 @@ TEST_F(WalletClientTest, GetFullWalletEncryptionDown) {
delegate_.ExpectBaselineMetrics(HAS_ESCROW_REQUEST, NO_WALLET_REQUEST);
delegate_.ExpectWalletErrorMetric(AutofillMetrics::WALLET_NETWORK_ERROR);
- Cart cart("total_price", "currency_code");
WalletClient::FullWalletRequest full_wallet_request(
"instrument_id",
"shipping_address_id",
GURL(kMerchantUrl),
- cart,
"google_transaction_id",
std::vector<WalletClient::RiskCapability>());
wallet_client_->GetFullWallet(full_wallet_request);
@@ -918,12 +901,10 @@ TEST_F(WalletClientTest, GetFullWalletEncryptionMalformed) {
delegate_.ExpectBaselineMetrics(HAS_ESCROW_REQUEST, NO_WALLET_REQUEST);
delegate_.ExpectWalletErrorMetric(AutofillMetrics::WALLET_MALFORMED_RESPONSE);
- Cart cart("total_price", "currency_code");
WalletClient::FullWalletRequest full_wallet_request(
"instrument_id",
"shipping_address_id",
GURL(kMerchantUrl),
- cart,
"google_transaction_id",
std::vector<WalletClient::RiskCapability>());
wallet_client_->GetFullWallet(full_wallet_request);
@@ -940,12 +921,10 @@ TEST_F(WalletClientTest, GetFullWalletMalformedResponse) {
delegate_.ExpectBaselineMetrics(HAS_ESCROW_REQUEST, HAS_WALLET_REQUEST);
delegate_.ExpectWalletErrorMetric(AutofillMetrics::WALLET_MALFORMED_RESPONSE);
- Cart cart("total_price", "currency_code");
WalletClient::FullWalletRequest full_wallet_request(
"instrument_id",
"shipping_address_id",
GURL(kMerchantUrl),
- cart,
"google_transaction_id",
std::vector<WalletClient::RiskCapability>());
wallet_client_->GetFullWallet(full_wallet_request);