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

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: Changes from Dane's review Created 8 years, 1 month 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..985b37d744605d06fe419729ac4a9514741ff493
--- /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/";
+
+std::string GetBaseWalletUrl() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ std::string baseWalletServiceUrl = command_line.GetSwitchValueASCII(
+ switches::kWalletServiceUrl);
+ if (baseWalletServiceUrl.empty())
+ return kDefaultWalletServiceUrl;
+
+ return baseWalletServiceUrl;
+}
+
+} // anonymous namespace
+
+const char wallet::kApiKey[] = "abcdefg";
+
+// TODO(ahutter): check url endpoints after they are all checked in
+
+GURL wallet::GetGetWalletItemsUrl() {
+ std::string baseWalletServiceUrl = GetBaseWalletUrl();
+ return GURL(baseWalletServiceUrl + "getWalletItemsJwtless");
+}
+
+GURL wallet::GetGetFullWalletUrl() {
+ std::string baseWalletServiceUrl = GetBaseWalletUrl();
+ return GURL(baseWalletServiceUrl + "getFullWalletJwtless");
+}
+GURL wallet::GetAcceptLegalDocumentsUrl() {
+ std::string baseWalletServiceUrl = GetBaseWalletUrl();
+ return GURL(baseWalletServiceUrl + "acceptLegalDocuments");
+}
+
+GURL wallet::GetSecureUrl() {
+ // TODO(ahutter): find a cleaner way to do this. Two flags?
+ return GURL("http://nogravitas.mtv.corp.google.com:8888/online-secure/"
Raman Kakilate 2012/11/17 04:10:51 get rid of this. and set is a flag similar to serv
ahutter 2012/11/27 00:46:12 Done.
+ "temporarydata/cvv?s7e=cvv");
+}
+
+GURL wallet::GetSendStatusUrl() {
+ std::string baseWalletServiceUrl = GetBaseWalletUrl();
+ return GURL(baseWalletServiceUrl + "reportStatus");
+}
+
+GURL wallet::GetSaveToWalletUrl() {
+ std::string baseWalletServiceUrl = GetBaseWalletUrl();
+ return GURL(baseWalletServiceUrl + "saveToWallet" );
+}

Powered by Google App Engine
This is Rietveld 408576698