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

Side by Side 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: Fixes from latest code review 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/autofill/wallet/wallet_service_url.h"
6
7 #include <string>
8
9 #include "base/command_line.h"
10 #include "chrome/common/chrome_switches.h"
11 #include "googleurl/src/gurl.h"
12
13 namespace {
14
15 const char kDefaultWalletServiceUrl[] =
16 "https://wallet.google.com/online/v2/wallet/autocheckout/";
17
18 const char kDefaultWalletSecureServiceUrl[] =
19 "https://wallet.google.com/online-secure/temporarydata/cvv?s7e=cvv";
20
21 GURL GetBaseWalletUrl() {
22 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
23 std::string baseWalletServiceUrl = command_line.GetSwitchValueASCII(
24 switches::kWalletServiceUrl);
25 return !baseWalletServiceUrl.empty() ? GURL(baseWalletServiceUrl) :
26 GURL(kDefaultWalletServiceUrl);
27 }
28
29 } // anonymous namespace
30
31 // TODO(ahutter): This shouldn't live in this class. See
32 // http://crbug.com/164281.
33 const char wallet::kApiKey[] = "abcdefg";
34
35 GURL wallet::GetGetWalletItemsUrl() {
36 return GetBaseWalletUrl().Resolve("getWalletItemsJwtless");
37 }
38
39 GURL wallet::GetGetFullWalletUrl() {
40 return GetBaseWalletUrl().Resolve("getFullWalletJwtless");
41 }
42 GURL wallet::GetAcceptLegalDocumentsUrl() {
43 return GetBaseWalletUrl().Resolve("acceptLegalDocuments");
44 }
45
46 GURL wallet::GetSendStatusUrl() {
47 return GetBaseWalletUrl().Resolve("reportStatus");
48 }
49
50 GURL wallet::GetSaveToWalletUrl() {
51 return GetBaseWalletUrl().Resolve("saveToWallet");
52 }
53
54 GURL wallet::GetSecureUrl() {
55 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
56 std::string walletSecureUrl = command_line.GetSwitchValueASCII(
57 switches::kWalletSecureServiceUrl);
58 return !walletSecureUrl.empty() ? GURL(walletSecureUrl) :
59 GURL(kDefaultWalletSecureServiceUrl);
60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698