OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CORE_BROWSER_PAYMENTS_PAYMENTS_REQUEST_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_REQUEST_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_REQUEST_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_REQUEST_H_ |
7 | 7 |
Mathieu
2016/04/04 13:36:17
include <memory>?
vabr (Chromium)
2016/04/04 14:29:05
Done.
| |
8 namespace autofill { | 8 namespace autofill { |
9 | 9 |
10 class AutofillClient; | 10 class AutofillClient; |
11 | 11 |
12 namespace payments { | 12 namespace payments { |
13 | 13 |
14 class PaymentsClientDelegate; | 14 class PaymentsClientDelegate; |
15 | 15 |
16 // Interface for the various Payments request types. | 16 // Interface for the various Payments request types. |
17 class PaymentsRequest { | 17 class PaymentsRequest { |
18 public: | 18 public: |
19 virtual ~PaymentsRequest() {} | 19 virtual ~PaymentsRequest() {} |
20 | 20 |
21 // Returns the URL path for this type of request. | 21 // Returns the URL path for this type of request. |
22 virtual std::string GetRequestUrlPath() = 0; | 22 virtual std::string GetRequestUrlPath() = 0; |
23 | 23 |
24 // Returns the content type that should be used in the HTTP request. | 24 // Returns the content type that should be used in the HTTP request. |
25 virtual std::string GetRequestContentType() = 0; | 25 virtual std::string GetRequestContentType() = 0; |
26 | 26 |
27 // Returns the content that should be provided in the HTTP request. | 27 // Returns the content that should be provided in the HTTP request. |
28 virtual std::string GetRequestContent() = 0; | 28 virtual std::string GetRequestContent() = 0; |
29 | 29 |
30 // Parses the required elements of the HTTP response. | 30 // Parses the required elements of the HTTP response. |
31 virtual void ParseResponse(scoped_ptr<base::DictionaryValue> response) = 0; | 31 virtual void ParseResponse( |
32 std::unique_ptr<base::DictionaryValue> response) = 0; | |
32 | 33 |
33 // Returns true if all of the required elements were successfully retrieved by | 34 // Returns true if all of the required elements were successfully retrieved by |
34 // a call to ParseResponse. | 35 // a call to ParseResponse. |
35 virtual bool IsResponseComplete() = 0; | 36 virtual bool IsResponseComplete() = 0; |
36 | 37 |
37 // Invokes the appropriate callback in the delegate based on what type of | 38 // Invokes the appropriate callback in the delegate based on what type of |
38 // request this is. | 39 // request this is. |
39 virtual void RespondToDelegate(PaymentsClientDelegate* delegate, | 40 virtual void RespondToDelegate(PaymentsClientDelegate* delegate, |
40 AutofillClient::PaymentsRpcResult result) = 0; | 41 AutofillClient::PaymentsRpcResult result) = 0; |
41 }; | 42 }; |
42 | 43 |
43 } // namespace payments | 44 } // namespace payments |
44 } // namespace autofill | 45 } // namespace autofill |
45 | 46 |
46 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_REQUEST_H_ | 47 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_REQUEST_H_ |
OLD | NEW |