OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 |
| 12 namespace payments { |
| 13 |
| 14 class PaymentRequestDialog; |
| 15 class PaymentRequestImpl; |
| 16 |
| 17 // The base class for objects responsible for the creation and event handling in |
| 18 // views shown in the PaymentRequestDialog. Subtypes should provide a |
| 19 // CreateView() static functions that returns the view they control. See |
| 20 // PaymentSheetViewController for an example. |
| 21 class PaymentRequestSheetController { |
| 22 public: |
| 23 PaymentRequestSheetController(PaymentRequestImpl* impl, |
| 24 PaymentRequestDialog* dialog) |
| 25 : impl_(impl), |
| 26 dialog_(dialog) {} |
| 27 virtual ~PaymentRequestSheetController() {} |
| 28 |
| 29 // The PaymentRequestImpl object associated with this instance of the dialog. |
| 30 PaymentRequestImpl* impl() { return impl_; } |
| 31 // The dialog that contains and owns this object. |
| 32 PaymentRequestDialog* dialog() { return dialog_; } |
| 33 |
| 34 private: |
| 35 PaymentRequestImpl* impl_; |
| 36 PaymentRequestDialog* dialog_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController); |
| 39 }; |
| 40 |
| 41 } // namespace payments |
| 42 |
| 43 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_SHEET_CONTROLLER_H_ |
OLD | NEW |