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

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

Issue 2528503002: [WebPayments] Implement state transitions in desktop WebPayments dialog. (Closed)
Patch Set: Make PaymentDialogState own the view returned through GetView 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..3910aeaef55b067896b1c4d98531fbbe10ea62a5
--- /dev/null
+++ b/chrome/browser/ui/views/payments/payment_sheet_state.h
@@ -0,0 +1,48 @@
+// 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_dialog_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 PaymentDialogState,
+ public views::ButtonListener {
+ public:
+ class Observer {
sky 2016/12/08 03:58:17 Similar comment about moving to standalone file.
anthonyvd 2016/12/08 20:31:23 Done.
+ public:
+ virtual void OnOrderSummaryClicked() {}
+ };
+
+ PaymentSheetState();
+ ~PaymentSheetState() override;
+
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ private:
+ // PaymentDialogState:
+ views::View* CreateView() override;
+
+ // views::ButtonListener:
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+
+ base::ObserverList<Observer> 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