Index: chrome/browser/ui/views/payments/payment_sheet_state.h |
diff --git a/chrome/browser/ui/views/payments/payment_sheet_state.h b/chrome/browser/ui/views/payments/payment_sheet_state.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6386817e7126e9335e18d5495a6bb3d39320db61 |
--- /dev/null |
+++ b/chrome/browser/ui/views/payments/payment_sheet_state.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_STATE_H_ |
+#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_STATE_H_ |
+ |
+#include "base/macros.h" |
+#include "chrome/browser/ui/views/payments/payment_sheet_state_observer.h" |
+#include "chrome/browser/ui/views/payments/view_stack_state.h" |
+#include "ui/views/controls/button/button.h" |
+ |
+namespace views { |
+class View; |
+} |
+ |
+namespace payments { |
+ |
+// Encapsulates view creation and event handling for the Payment Sheet screen of |
+// the desktop WebPayments UI. |
+class PaymentSheetState : public ViewStackState, |
+ public views::ButtonListener { |
+ public: |
+ PaymentSheetState(); |
+ ~PaymentSheetState() override; |
+ |
+ void AddObserver(PaymentSheetStateObserver* observer); |
+ void RemoveObserver(PaymentSheetStateObserver* observer); |
+ |
+ private: |
+ // ViewStackState: |
+ views::View* CreateView() override; |
+ |
+ // views::ButtonListener: |
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
+ |
+ base::ObserverList<PaymentSheetStateObserver> observers_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PaymentSheetState); |
+}; |
+ |
+} // namespace payments |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_STATE_H_ |