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

Unified Diff: chrome/browser/autofill/wallet/wallet_service_url.cc

Issue 11293078: Integrating Online Wallet into Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing HexStringToInt Created 8 years 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/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..f94d90d266e81a419b6c4accf734373a9ef06f14
--- /dev/null
+++ b/chrome/browser/autofill/wallet/wallet_service_url.cc
@@ -0,0 +1,62 @@
+// 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 base_wallet_service_url =
+ command_line.GetSwitchValueASCII(switches::kWalletServiceUrl);
+ return !base_wallet_service_url.empty() ? GURL(base_wallet_service_url) :
+ GURL(kDefaultWalletServiceUrl);
+}
+
+} // 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");
+}
+
+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 wallet_secure_url =
+ command_line.GetSwitchValueASCII(switches::kWalletSecureServiceUrl);
+ return !wallet_secure_url.empty() ? GURL(wallet_secure_url) :
+ GURL(kDefaultWalletSecureServiceUrl);
+}
+
« no previous file with comments | « chrome/browser/autofill/wallet/wallet_service_url.h ('k') | chrome/browser/autofill/wallet/wallet_service_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698