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

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

Issue 2528503002: [WebPayments] Implement state transitions in desktop WebPayments dialog. (Closed)
Patch Set: Change ToggleInteractable to SetInteractable Created 4 years, 1 month 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/payments/ui/payment_sheet_state.h
diff --git a/chrome/browser/payments/ui/payment_sheet_state.h b/chrome/browser/payments/ui/payment_sheet_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..6743dd714883a07d163d37ff84e9f2793d7e37c4
--- /dev/null
+++ b/chrome/browser/payments/ui/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_PAYMENTS_UI_PAYMENT_SHEET_STATE_H_
+#define CHROME_BROWSER_PAYMENTS_UI_PAYMENT_SHEET_STATE_H_
+
+#include "base/macros.h"
+#include "chrome/browser/payments/ui/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 {
+ public:
+ virtual void OnOrderSummaryClicked() {}
+ };
+
+ PaymentSheetState();
+ ~PaymentSheetState() override;
+
+ // PaymentDialogState:
+ views::View* GetView() override;
+
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ private:
please use gerrit instead 2016/11/22 21:39:33 // InterfaceBeingImplemented:
anthonyvd 2016/11/22 22:11:19 Done.
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+
+ views::View* view_;
please use gerrit instead 2016/11/22 21:39:33 std::unique_ptr<> if you own this object.
anthonyvd 2016/11/22 22:11:19 See above comments, this object doesn't.
+ base::ObserverList<Observer> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(PaymentSheetState);
+};
+
+} // namespace payments
+
+#endif // CHROME_BROWSER_PAYMENTS_UI_PAYMENT_SHEET_STATE_H_

Powered by Google App Engine
This is Rietveld 408576698