Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ |
| 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ | 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "components/autofill/core/browser/autofill_client.h" | |
| 12 #include "components/autofill/core/browser/payments/full_card_request.h" | |
| 13 #include "components/payments/core/autofill_payment_instrument.h" | |
|
please use gerrit instead
2017/03/30 13:14:09
Why are weak_ptr, autofill_client, and autofill_pa
anthonyvd
2017/03/30 15:43:41
Good catch, this code changed a lot while writing
| |
| 14 | |
| 10 namespace autofill { | 15 namespace autofill { |
| 11 class PersonalDataManager; | 16 class PersonalDataManager; |
| 12 } | 17 } |
| 13 | 18 |
| 14 namespace payments { | 19 namespace payments { |
| 15 | 20 |
| 16 class PaymentRequest; | 21 class PaymentRequest; |
| 17 | 22 |
| 18 class PaymentRequestDelegate { | 23 class PaymentRequestDelegate |
| 24 : public AutofillPaymentInstrument::FullCardRequestDelegate { | |
| 19 public: | 25 public: |
| 20 virtual ~PaymentRequestDelegate() {} | 26 virtual ~PaymentRequestDelegate() {} |
| 21 | 27 |
| 22 // Shows the Payment Request dialog for the given |request|. | 28 // Shows the Payment Request dialog for the given |request|. |
| 23 virtual void ShowDialog(PaymentRequest* request) = 0; | 29 virtual void ShowDialog(PaymentRequest* request) = 0; |
| 24 | 30 |
| 25 // Closes the same dialog that was opened by this delegate. Must be safe to | 31 // Closes the same dialog that was opened by this delegate. Must be safe to |
| 26 // call when the dialog is not showing. | 32 // call when the dialog is not showing. |
| 27 virtual void CloseDialog() = 0; | 33 virtual void CloseDialog() = 0; |
| 28 | 34 |
| 29 // Disables the dialog and shows an error message that the transaction has | 35 // Disables the dialog and shows an error message that the transaction has |
| 30 // failed. | 36 // failed. |
| 31 virtual void ShowErrorMessage() = 0; | 37 virtual void ShowErrorMessage() = 0; |
| 32 | 38 |
| 33 // Gets the PersonalDataManager associated with this PaymentRequest flow. | 39 // Gets the PersonalDataManager associated with this PaymentRequest flow. |
| 34 // Cannot be null. | 40 // Cannot be null. |
| 35 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; | 41 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; |
| 36 | 42 |
| 37 virtual const std::string& GetApplicationLocale() const = 0; | 43 virtual const std::string& GetApplicationLocale() const = 0; |
| 38 | 44 |
| 39 // Returns whether the user is in Incognito mode. | 45 // Returns whether the user is in Incognito mode. |
| 40 virtual bool IsIncognito() const = 0; | 46 virtual bool IsIncognito() const = 0; |
| 41 }; | 47 }; |
| 42 | 48 |
| 43 } // namespace payments | 49 } // namespace payments |
| 44 | 50 |
| 45 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ | 51 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ |
| OLD | NEW |