OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 DISALLOW_ASSIGN(FullWalletRequest); | 135 DISALLOW_ASSIGN(FullWalletRequest); |
136 }; | 136 }; |
137 | 137 |
138 // |context_getter| is reference counted so it has no lifetime or ownership | 138 // |context_getter| is reference counted so it has no lifetime or ownership |
139 // requirements. |delegate| must outlive |this|. |source_url| is the url | 139 // requirements. |delegate| must outlive |this|. |source_url| is the url |
140 // of the merchant page. | 140 // of the merchant page. |
141 WalletClient(net::URLRequestContextGetter* context_getter, | 141 WalletClient(net::URLRequestContextGetter* context_getter, |
142 WalletClientDelegate* delegate, | 142 WalletClientDelegate* delegate, |
143 const GURL& source_url); | 143 const GURL& source_url); |
144 | 144 |
145 virtual ~WalletClient(); | 145 ~WalletClient() override; |
146 | 146 |
147 // GetWalletItems retrieves the user's online wallet. The WalletItems | 147 // GetWalletItems retrieves the user's online wallet. The WalletItems |
148 // returned may require additional action such as presenting legal documents | 148 // returned may require additional action such as presenting legal documents |
149 // to the user to be accepted. | 149 // to the user to be accepted. |
150 virtual void GetWalletItems(const base::string16& amount, | 150 virtual void GetWalletItems(const base::string16& amount, |
151 const base::string16& currency); | 151 const base::string16& currency); |
152 | 152 |
153 // The GetWalletItems call to the Online Wallet backend may require the user | 153 // The GetWalletItems call to the Online Wallet backend may require the user |
154 // to accept various legal documents before a FullWallet can be generated. | 154 // to accept various legal documents before a FullWallet can be generated. |
155 // The |google_transaction_id| is provided in the response to the | 155 // The |google_transaction_id| is provided in the response to the |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 const std::string& mime_type, | 216 const std::string& mime_type, |
217 RequestType request_type); | 217 RequestType request_type); |
218 | 218 |
219 // Performs bookkeeping tasks for any invalid requests. | 219 // Performs bookkeeping tasks for any invalid requests. |
220 void HandleMalformedResponse(RequestType request_type, | 220 void HandleMalformedResponse(RequestType request_type, |
221 net::URLFetcher* request); | 221 net::URLFetcher* request); |
222 void HandleNetworkError(int response_code); | 222 void HandleNetworkError(int response_code); |
223 void HandleWalletError(ErrorType error_type); | 223 void HandleWalletError(ErrorType error_type); |
224 | 224 |
225 // net::URLFetcherDelegate: | 225 // net::URLFetcherDelegate: |
226 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; | 226 void OnURLFetchComplete(const net::URLFetcher* source) override; |
227 | 227 |
228 // Logs an UMA metric for each of the |required_actions|. | 228 // Logs an UMA metric for each of the |required_actions|. |
229 void LogRequiredActions( | 229 void LogRequiredActions( |
230 const std::vector<RequiredAction>& required_actions) const; | 230 const std::vector<RequiredAction>& required_actions) const; |
231 | 231 |
232 // Converts |request_type| to an UMA metric. | 232 // Converts |request_type| to an UMA metric. |
233 AutofillMetrics::WalletApiCallMetric RequestTypeToUmaMetric( | 233 AutofillMetrics::WalletApiCallMetric RequestTypeToUmaMetric( |
234 RequestType request_type) const; | 234 RequestType request_type) const; |
235 | 235 |
236 // The context for the request. Ensures the gdToken cookie is set as a header | 236 // The context for the request. Ensures the gdToken cookie is set as a header |
(...skipping 26 matching lines...) Expand all Loading... |
263 | 263 |
264 base::WeakPtrFactory<WalletClient> weak_ptr_factory_; | 264 base::WeakPtrFactory<WalletClient> weak_ptr_factory_; |
265 | 265 |
266 DISALLOW_COPY_AND_ASSIGN(WalletClient); | 266 DISALLOW_COPY_AND_ASSIGN(WalletClient); |
267 }; | 267 }; |
268 | 268 |
269 } // namespace wallet | 269 } // namespace wallet |
270 } // namespace autofill | 270 } // namespace autofill |
271 | 271 |
272 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ | 272 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ |
OLD | NEW |