Commit 402ae85c authored by abodenha@chromium.org's avatar abodenha@chromium.org

Change the behavior of --wallet-service-url.

--wallet-service-url now specifies a prefix rather than a full path to autocheckout.
The default value is https://wallet.google.com/online/v2/ and the rest of each Wallet
URL will be appended to construct a working URL.
Also changed function prototypes to use the namespace in a more common way.
(namespace wallet {... vs wallet::)

BUG=168278


Review URL: https://chromiumcodereview.appspot.com/11791003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175250 0039d316-1c4b-4281-b951-d872f2087c98
parent 6d2bd3fc
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
namespace { namespace {
const char kDefaultWalletServiceUrl[] = const char kDefaultWalletServiceUrl[] = "https://wallet.google.com/online/v2/";
"https://wallet.google.com/online/v2/wallet/autocheckout/";
const char kDefaultWalletSecureServiceUrl[] = const char kDefaultWalletSecureServiceUrl[] =
"https://wallet.google.com/online-secure/temporarydata/cvv?s7e=cvv"; "https://wallet.google.com/online-secure/temporarydata/cvv?s7e=cvv";
...@@ -26,33 +25,44 @@ GURL GetBaseWalletUrl() { ...@@ -26,33 +25,44 @@ GURL GetBaseWalletUrl() {
GURL(kDefaultWalletServiceUrl); GURL(kDefaultWalletServiceUrl);
} }
GURL GetBaseAutocheckoutUrl() {
return GetBaseWalletUrl().Resolve("wallet/autocheckout/");
}
} // anonymous namespace } // anonymous namespace
namespace wallet {
// TODO(ahutter): This shouldn't live in this class. See // TODO(ahutter): This shouldn't live in this class. See
// http://crbug.com/164281. // http://crbug.com/164281.
const char wallet::kApiKey[] = "abcdefg"; const char kApiKey[] = "abcdefg";
GURL GetGetWalletItemsUrl() {
return GetBaseWalletUrl().Resolve(
"wallet/autocheckout/getWalletItemsJwtless");
}
GURL wallet::GetGetWalletItemsUrl() { GURL GetGetFullWalletUrl() {
return GetBaseWalletUrl().Resolve("getWalletItemsJwtless"); return GetBaseAutocheckoutUrl().Resolve("getFullWalletJwtless");
} }
GURL wallet::GetGetFullWalletUrl() { GURL GetAcceptLegalDocumentsUrl() {
return GetBaseWalletUrl().Resolve("getFullWalletJwtless"); return GetBaseAutocheckoutUrl().Resolve("acceptLegalDocuments");
} }
GURL wallet::GetAcceptLegalDocumentsUrl() { GURL GetSendStatusUrl() {
return GetBaseWalletUrl().Resolve("acceptLegalDocuments"); return GetBaseAutocheckoutUrl().Resolve("reportStatus");
} }
GURL wallet::GetSendStatusUrl() { GURL GetSaveToWalletUrl() {
return GetBaseWalletUrl().Resolve("reportStatus"); return GetBaseAutocheckoutUrl().Resolve("saveToWallet");
} }
GURL wallet::GetSaveToWalletUrl() { GURL GetPassiveAuthUrl() {
return GetBaseWalletUrl().Resolve("saveToWallet"); return GetBaseWalletUrl().Resolve("passiveauth");
} }
GURL wallet::GetSecureUrl() { GURL GetSecureUrl() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
std::string wallet_secure_url = std::string wallet_secure_url =
command_line.GetSwitchValueASCII(switches::kWalletSecureServiceUrl); command_line.GetSwitchValueASCII(switches::kWalletSecureServiceUrl);
...@@ -60,3 +70,4 @@ GURL wallet::GetSecureUrl() { ...@@ -60,3 +70,4 @@ GURL wallet::GetSecureUrl() {
GURL(kDefaultWalletSecureServiceUrl); GURL(kDefaultWalletSecureServiceUrl);
} }
} // namespace wallet
...@@ -16,6 +16,7 @@ GURL GetAcceptLegalDocumentsUrl(); ...@@ -16,6 +16,7 @@ GURL GetAcceptLegalDocumentsUrl();
GURL GetSecureUrl(); GURL GetSecureUrl();
GURL GetSendStatusUrl(); GURL GetSendStatusUrl();
GURL GetSaveToWalletUrl(); GURL GetSaveToWalletUrl();
GURL GetPassiveAuthUrl();
} // namespace wallet } // namespace wallet
......
...@@ -24,6 +24,8 @@ TEST(WalletServiceUrl, CheckDefaultUrls) { ...@@ -24,6 +24,8 @@ TEST(WalletServiceUrl, CheckDefaultUrls) {
ASSERT_EQ("https://wallet.google.com/online/v2/wallet/autocheckout/" ASSERT_EQ("https://wallet.google.com/online/v2/wallet/autocheckout/"
"saveToWallet", "saveToWallet",
GetSaveToWalletUrl().spec()); GetSaveToWalletUrl().spec());
ASSERT_EQ("https://wallet.google.com/online/v2/passiveauth",
GetPassiveAuthUrl().spec());
ASSERT_EQ("https://wallet.google.com/online-secure/temporarydata/cvv?s7e=cvv", ASSERT_EQ("https://wallet.google.com/online-secure/temporarydata/cvv?s7e=cvv",
GetSecureUrl().spec()); GetSecureUrl().spec());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment