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