Chromium Code Reviews| Index: chrome/browser/autofill/wallet/wallet_service_url.cc |
| diff --git a/chrome/browser/autofill/wallet/wallet_service_url.cc b/chrome/browser/autofill/wallet/wallet_service_url.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b9e6d5ce3c754b6d428e911fc207598a982b7175 |
| --- /dev/null |
| +++ b/chrome/browser/autofill/wallet/wallet_service_url.cc |
| @@ -0,0 +1,61 @@ |
| +// 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 "chrome/browser/autofill/wallet/wallet_service_url.h" |
| + |
| +#include <string> |
| + |
| +#include "base/command_line.h" |
| +#include "chrome/common/chrome_switches.h" |
| +#include "googleurl/src/gurl.h" |
| + |
| +namespace { |
| + |
| +const char kDefaultWalletServiceUrl[] = |
| + "https://wallet.google.com/online/v2/wallet/autocheckout/"; |
| + |
| +const char kDefaultWalletSecureServiceUrl[] = |
| + "https://wallet.google.com/online-secure/temporarydata/cvv?s7e=cvv"; |
| + |
| +GURL GetBaseWalletUrl() { |
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + std::string baseWalletServiceUrl = command_line.GetSwitchValueASCII( |
|
Evan Stade
2012/12/07 19:57:44
variable names go_like_this
also, break the line
ahutter
2012/12/15 01:06:31
Done.
|
| + switches::kWalletServiceUrl); |
| + return !baseWalletServiceUrl.empty() ? GURL(baseWalletServiceUrl) : |
| + GURL(kDefaultWalletServiceUrl); |
|
Evan Stade
2012/12/07 19:57:44
indent this to match the first GURL if possible
ahutter
2012/12/15 01:06:31
Done.
|
| +} |
| + |
| +} // anonymous namespace |
| + |
| +// TODO(ahutter): This shouldn't live in this class. See |
| +// http://crbug.com/164281. |
| +const char wallet::kApiKey[] = "abcdefg"; |
| + |
| +GURL wallet::GetGetWalletItemsUrl() { |
| + return GetBaseWalletUrl().Resolve("getWalletItemsJwtless"); |
| +} |
| + |
| +GURL wallet::GetGetFullWalletUrl() { |
| + return GetBaseWalletUrl().Resolve("getFullWalletJwtless"); |
| +} |
|
Evan Stade
2012/12/07 19:57:44
\n
ahutter
2012/12/15 01:06:31
Done.
|
| +GURL wallet::GetAcceptLegalDocumentsUrl() { |
| + return GetBaseWalletUrl().Resolve("acceptLegalDocuments"); |
| +} |
| + |
| +GURL wallet::GetSendStatusUrl() { |
| + return GetBaseWalletUrl().Resolve("reportStatus"); |
| +} |
| + |
| +GURL wallet::GetSaveToWalletUrl() { |
| + return GetBaseWalletUrl().Resolve("saveToWallet"); |
| +} |
| + |
| +GURL wallet::GetSecureUrl() { |
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + std::string walletSecureUrl = command_line.GetSwitchValueASCII( |
| + switches::kWalletSecureServiceUrl); |
| + return !walletSecureUrl.empty() ? GURL(walletSecureUrl) : |
|
Evan Stade
2012/12/07 19:57:44
looks like a there's an extra space here
ahutter
2012/12/15 01:06:31
Done.
|
| + GURL(kDefaultWalletSecureServiceUrl); |
|
Evan Stade
2012/12/07 19:57:44
indent this to match the first GURL if possible
ahutter
2012/12/15 01:06:31
Done.
|
| +} |
| + |