Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3033)

Unified Diff: chrome/browser/ui/views/payments/payment_sheet_state.h

Issue 2528503002: [WebPayments] Implement state transitions in desktop WebPayments dialog. (Closed)
Patch Set: Factor out ViewStack and animations Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698