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> | |
|
please use gerrit instead
2017/03/30 13:14:09
Only used when overriding PaymentRequestDelegate,
anthonyvd
2017/03/30 15:43:40
cpplint disagrees :(
| |
| 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; |
|
please use gerrit instead
2017/03/30 13:14:09
Only used when overriding PaymentRequestDelegate,
anthonyvd
2017/03/30 15:43:40
Done.
| |
| 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 |
|
please use gerrit instead
2017/03/30 13:14:09
Add a comment that this overrides PaymentRequestDe
anthonyvd
2017/03/30 15:43:40
Done.
| |
| 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; |
| 31 | 33 |
| 34 // AutofillPaymentInstrument::FullCardRequestDelegate: | |
| 35 void DoFullCardRequest( | |
| 36 const autofill::CreditCard& credit_card, | |
| 37 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> | |
| 38 result_delegate) override; | |
| 39 | |
| 32 protected: | 40 protected: |
| 33 // Reference to the dialog so that we can satisfy calls to CloseDialog(). This | 41 // 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 | 42 // reference is invalid once CloseDialog() has been called on it, because the |
| 35 // dialog will be destroyed. Protected for testing. | 43 // dialog will be destroyed. Protected for testing. |
| 36 PaymentRequestDialog* dialog_; | 44 PaymentRequestDialog* dialog_; |
| 37 | 45 |
| 38 private: | 46 private: |
| 39 // Not owned but outlives the PaymentRequest object that owns this. | 47 // Not owned but outlives the PaymentRequest object that owns this. |
| 40 content::WebContents* web_contents_; | 48 content::WebContents* web_contents_; |
| 41 | 49 |
| 42 DISALLOW_COPY_AND_ASSIGN(ChromePaymentRequestDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(ChromePaymentRequestDelegate); |
| 43 }; | 51 }; |
| 44 | 52 |
| 45 } // namespace payments | 53 } // namespace payments |
| 46 | 54 |
| 47 #endif // CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ | 55 #endif // CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ |
| OLD | NEW |