| 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 CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ | 6 #define CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "components/payments/content/payment_request_delegate.h" | 11 #include "components/payments/core/payment_request_delegate.h" |
| 10 | 12 |
| 11 namespace content { | 13 namespace content { |
| 12 class WebContents; | 14 class WebContents; |
| 13 } | 15 } |
| 14 | 16 |
| 15 namespace payments { | 17 namespace payments { |
| 16 | 18 |
| 17 class PaymentRequest; | |
| 18 class PaymentRequestDialog; | 19 class PaymentRequestDialog; |
| 19 | 20 |
| 20 class ChromePaymentRequestDelegate : public PaymentRequestDelegate { | 21 class ChromePaymentRequestDelegate : public PaymentRequestDelegate { |
| 21 public: | 22 public: |
| 22 explicit ChromePaymentRequestDelegate(content::WebContents* web_contents); | 23 explicit ChromePaymentRequestDelegate(content::WebContents* web_contents); |
| 23 ~ChromePaymentRequestDelegate() override {} | 24 ~ChromePaymentRequestDelegate() override {} |
| 24 | 25 |
| 26 // PaymentRequestDelegate: |
| 25 void ShowDialog(PaymentRequest* request) override; | 27 void ShowDialog(PaymentRequest* request) override; |
| 26 void CloseDialog() override; | 28 void CloseDialog() override; |
| 27 void ShowErrorMessage() override; | 29 void ShowErrorMessage() override; |
| 28 autofill::PersonalDataManager* GetPersonalDataManager() override; | 30 autofill::PersonalDataManager* GetPersonalDataManager() override; |
| 29 const std::string& GetApplicationLocale() const override; | 31 const std::string& GetApplicationLocale() const override; |
| 30 bool IsIncognito() const override; | 32 bool IsIncognito() const override; |
| 33 void DoFullCardRequest( |
| 34 const autofill::CreditCard& credit_card, |
| 35 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
| 36 result_delegate) override; |
| 31 | 37 |
| 32 protected: | 38 protected: |
| 33 // Reference to the dialog so that we can satisfy calls to CloseDialog(). This | 39 // Reference to the dialog so that we can satisfy calls to CloseDialog(). This |
| 34 // reference is invalid once CloseDialog() has been called on it, because the | 40 // reference is invalid once CloseDialog() has been called on it, because the |
| 35 // dialog will be destroyed. Protected for testing. | 41 // dialog will be destroyed. Protected for testing. |
| 36 PaymentRequestDialog* dialog_; | 42 PaymentRequestDialog* dialog_; |
| 37 | 43 |
| 38 private: | 44 private: |
| 39 // Not owned but outlives the PaymentRequest object that owns this. | 45 // Not owned but outlives the PaymentRequest object that owns this. |
| 40 content::WebContents* web_contents_; | 46 content::WebContents* web_contents_; |
| 41 | 47 |
| 42 DISALLOW_COPY_AND_ASSIGN(ChromePaymentRequestDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(ChromePaymentRequestDelegate); |
| 43 }; | 49 }; |
| 44 | 50 |
| 45 } // namespace payments | 51 } // namespace payments |
| 46 | 52 |
| 47 #endif // CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ | 53 #endif // CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ |
| OLD | NEW |