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_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 TestChromePaymentRequestDelegate( | 29 TestChromePaymentRequestDelegate( |
30 content::WebContents* web_contents, | 30 content::WebContents* web_contents, |
31 PaymentRequestDialogView::ObserverForTest* observer, | 31 PaymentRequestDialogView::ObserverForTest* observer, |
32 views::WidgetObserver* widget_observer, | 32 views::WidgetObserver* widget_observer, |
33 bool is_incognito, | 33 bool is_incognito, |
34 bool is_valid_ssl); | 34 bool is_valid_ssl); |
35 | 35 |
36 // This class allows tests to provide their own AddressInput data. | 36 // This class allows tests to provide their own AddressInput data. |
37 class AddressInputProvider { | 37 class AddressInputProvider { |
38 public: | 38 public: |
39 virtual std::unique_ptr<const ::i18n::addressinput::Source> | 39 virtual std::unique_ptr<::i18n::addressinput::Source> |
40 GetAddressInputSource() = 0; | 40 GetAddressInputSource() = 0; |
41 virtual std::unique_ptr<::i18n::addressinput::Storage> | 41 virtual std::unique_ptr<::i18n::addressinput::Storage> |
42 GetAddressInputStorage() = 0; | 42 GetAddressInputStorage() = 0; |
43 }; | 43 }; |
44 | 44 |
45 void SetAddressInputOverride(AddressInputProvider* address_input_provider) { | 45 void SetAddressInputOverride(AddressInputProvider* address_input_provider) { |
46 address_input_provider_ = address_input_provider; | 46 address_input_provider_ = address_input_provider; |
47 } | 47 } |
48 | 48 |
49 // ChromePaymentRequestDelegate. | 49 // ChromePaymentRequestDelegate. |
50 void ShowDialog(PaymentRequest* request) override; | 50 void ShowDialog(PaymentRequest* request) override; |
51 bool IsIncognito() const override; | 51 bool IsIncognito() const override; |
52 bool IsSslCertificateValid() override; | 52 bool IsSslCertificateValid() override; |
53 std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource() | 53 std::unique_ptr<::i18n::addressinput::Source> GetAddressInputSource() |
54 override; | 54 override; |
55 std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage() | 55 std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage() |
56 override; | 56 override; |
57 | 57 |
58 PaymentRequestDialogView* dialog_view() { | 58 PaymentRequestDialogView* dialog_view() { |
59 return static_cast<PaymentRequestDialogView*>(dialog_); | 59 return static_cast<PaymentRequestDialogView*>(dialog_); |
60 } | 60 } |
61 | 61 |
62 private: | 62 private: |
63 // Not owned so must outlive the PaymentRequest object; | 63 // Not owned so must outlive the PaymentRequest object; |
64 AddressInputProvider* address_input_provider_; | 64 AddressInputProvider* address_input_provider_; |
65 | 65 |
66 PaymentRequestDialogView::ObserverForTest* observer_; | 66 PaymentRequestDialogView::ObserverForTest* observer_; |
67 views::WidgetObserver* widget_observer_; | 67 views::WidgetObserver* widget_observer_; |
68 bool is_incognito_; | 68 bool is_incognito_; |
69 bool is_valid_ssl_; | 69 bool is_valid_ssl_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(TestChromePaymentRequestDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(TestChromePaymentRequestDelegate); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace payments | 74 } // namespace payments |
75 | 75 |
76 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE
_H_ | 76 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE
_H_ |
OLD | NEW |