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_CLIENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_CLIENT_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_CLIENT_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Returns the legal message retrieved from Payments. On failure or not | 41 // Returns the legal message retrieved from Payments. On failure or not |
42 // meeting Payments's conditions for upload, |legal_message| will contain | 42 // meeting Payments's conditions for upload, |legal_message| will contain |
43 // nullptr. | 43 // nullptr. |
44 virtual void OnDidGetUploadDetails( | 44 virtual void OnDidGetUploadDetails( |
45 AutofillClient::PaymentsRpcResult result, | 45 AutofillClient::PaymentsRpcResult result, |
46 const base::string16& context_token, | 46 const base::string16& context_token, |
47 std::unique_ptr<base::DictionaryValue> legal_message) = 0; | 47 std::unique_ptr<base::DictionaryValue> legal_message) = 0; |
48 | 48 |
49 // Returns the result of an upload request. | 49 // Returns the result of an upload request. |
50 virtual void OnDidUploadCard(AutofillClient::PaymentsRpcResult result) = 0; | 50 // If |result| == |AutofillClient::SUCCESS|, |server_id| may, optionally, |
| 51 // contain the opaque identifier for the card on the server. |
| 52 virtual void OnDidUploadCard(AutofillClient::PaymentsRpcResult result, |
| 53 const std::string& server_id) = 0; |
51 }; | 54 }; |
52 | 55 |
53 // PaymentsClient issues Payments RPCs and manages responses and failure | 56 // PaymentsClient issues Payments RPCs and manages responses and failure |
54 // conditions. Only one request may be active at a time. Initiating a new | 57 // conditions. Only one request may be active at a time. Initiating a new |
55 // request will cancel a pending request. | 58 // request will cancel a pending request. |
56 // Tests are located in | 59 // Tests are located in |
57 // src/components/autofill/content/browser/payments/payments_client_unittest.cc. | 60 // src/components/autofill/content/browser/payments/payments_client_unittest.cc. |
58 class PaymentsClient : public net::URLFetcherDelegate, | 61 class PaymentsClient : public net::URLFetcherDelegate, |
59 public OAuth2TokenService::Consumer { | 62 public OAuth2TokenService::Consumer { |
60 public: | 63 public: |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 178 |
176 base::WeakPtrFactory<PaymentsClient> weak_ptr_factory_; | 179 base::WeakPtrFactory<PaymentsClient> weak_ptr_factory_; |
177 | 180 |
178 DISALLOW_COPY_AND_ASSIGN(PaymentsClient); | 181 DISALLOW_COPY_AND_ASSIGN(PaymentsClient); |
179 }; | 182 }; |
180 | 183 |
181 } // namespace payments | 184 } // namespace payments |
182 } // namespace autofill | 185 } // namespace autofill |
183 | 186 |
184 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_CLIENT_H_ | 187 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_PAYMENTS_CLIENT_H_ |
OLD | NEW |