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

Side by Side Diff: components/autofill/core/browser/payments/payments_client.h

Issue 2829853008: Stores server card as a full server card when upload to server succeeds. (Closed)
Patch Set: Renames AddServerCreditCard to AddFullServerCreditCard. Adds DCHECK to verify that we are in a tran… Created 3 years, 8 months 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
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698