OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 // Objects of this class are owned by |dialog|, so it's a non-owned pointer | 27 // Objects of this class are owned by |dialog|, so it's a non-owned pointer |
28 // that should be valid throughout this object's lifetime. | 28 // that should be valid throughout this object's lifetime. |
29 // |request| is also not owned by this and is guaranteed to outlive dialog. | 29 // |request| is also not owned by this and is guaranteed to outlive dialog. |
30 // Neither |request| or |dialog| should be null. | 30 // Neither |request| or |dialog| should be null. |
31 PaymentRequestSheetController(PaymentRequest* request, | 31 PaymentRequestSheetController(PaymentRequest* request, |
32 PaymentRequestDialogView* dialog); | 32 PaymentRequestDialogView* dialog); |
33 ~PaymentRequestSheetController() override {} | 33 ~PaymentRequestSheetController() override {} |
34 | 34 |
35 virtual std::unique_ptr<views::View> CreateView() = 0; | 35 virtual std::unique_ptr<views::View> CreateView() = 0; |
36 // A leading view to complement the button(s). See CreateFooterView for how | |
37 // this is used and what insets are already applied. | |
38 virtual std::unique_ptr<views::View> CreateLeadingFooterView(); | |
39 | 36 |
40 // The PaymentRequest object associated with this instance of the dialog. | 37 // The PaymentRequest object associated with this instance of the dialog. |
41 // Caller should not take ownership of the result. | 38 // Caller should not take ownership of the result. |
42 PaymentRequest* request() { return request_; } | 39 PaymentRequest* request() { return request_; } |
43 | 40 |
44 // The dialog that contains and owns this object. | 41 // The dialog that contains and owns this object. |
45 // Caller should not take ownership of the result. | 42 // Caller should not take ownership of the result. |
46 PaymentRequestDialogView* dialog() { return dialog_; } | 43 PaymentRequestDialogView* dialog() { return dialog_; } |
47 | 44 |
48 protected: | 45 protected: |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 PaymentRequest* request_; | 94 PaymentRequest* request_; |
98 // Not owned. Will outlive this. | 95 // Not owned. Will outlive this. |
99 PaymentRequestDialogView* dialog_; | 96 PaymentRequestDialogView* dialog_; |
100 | 97 |
101 DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController); | 98 DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController); |
102 }; | 99 }; |
103 | 100 |
104 } // namespace payments | 101 } // namespace payments |
105 | 102 |
106 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ | 103 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
OLD | NEW |