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