OLD | NEW |
---|---|
(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 std::string GetBaseWalletUrl() { | |
Dan Beam
2012/12/01 01:19:49
nit: return a GURL
ahutter
2012/12/01 04:06:51
Done.
| |
22 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
23 std::string baseWalletServiceUrl = command_line.GetSwitchValueASCII( | |
24 switches::kWalletServiceUrl); | |
25 if (baseWalletServiceUrl.empty()) | |
Dan Beam
2012/12/01 01:19:49
nit: ternary, IMO, i.e.
return !baseWalletServi
ahutter
2012/12/01 04:06:51
Done.
| |
26 return kDefaultWalletServiceUrl; | |
27 | |
28 return baseWalletServiceUrl; | |
29 } | |
30 | |
31 } // anonymous namespace | |
32 | |
33 // TODO(ahutter): Should this live here? | |
Dan Beam
2012/12/01 01:19:49
no, this will probably need to go into a different
ahutter
2012/12/01 04:06:51
Who should I ask about that?
| |
34 const char wallet::kApiKey[] = "abcdefg"; | |
35 | |
36 GURL wallet::GetGetWalletItemsUrl() { | |
37 std::string baseWalletServiceUrl = GetBaseWalletUrl(); | |
38 return GURL(baseWalletServiceUrl + "getWalletItemsJwtless"); | |
Dan Beam
2012/12/01 01:19:49
once GetBaseWalletUrl() returns a GURL
return G
ahutter
2012/12/01 04:06:51
Done.
| |
39 } | |
40 | |
41 GURL wallet::GetGetFullWalletUrl() { | |
42 std::string baseWalletServiceUrl = GetBaseWalletUrl(); | |
43 return GURL(baseWalletServiceUrl + "getFullWalletJwtless"); | |
44 } | |
45 GURL wallet::GetAcceptLegalDocumentsUrl() { | |
46 std::string baseWalletServiceUrl = GetBaseWalletUrl(); | |
47 return GURL(baseWalletServiceUrl + "acceptLegalDocuments"); | |
48 } | |
49 | |
50 GURL wallet::GetSendStatusUrl() { | |
51 std::string baseWalletServiceUrl = GetBaseWalletUrl(); | |
52 return GURL(baseWalletServiceUrl + "reportStatus"); | |
53 } | |
54 | |
55 GURL wallet::GetSaveToWalletUrl() { | |
56 std::string baseWalletServiceUrl = GetBaseWalletUrl(); | |
57 return GURL(baseWalletServiceUrl + "saveToWallet" ); | |
58 } | |
59 | |
60 GURL wallet::GetSecureUrl() { | |
61 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
62 std::string walletSecureUrl = command_line.GetSwitchValueASCII( | |
63 switches::kWalletSecureServiceUrl); | |
64 if (walletSecureUrl.empty()) | |
Dan Beam
2012/12/01 01:19:49
same nit re: ternary or order
ahutter
2012/12/01 04:06:51
Done.
| |
65 return GURL(kDefaultWalletSecureServiceUrl); | |
66 | |
67 return GURL(walletSecureUrl); | |
68 } | |
OLD | NEW |