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

Side by Side Diff: chrome/browser/ui/views/payments/order_summary_view_controller.h

Issue 2742813004: [Payments] Refactor into PaymentRequestState and Spec (Closed)
Patch Set: don't stop rebasin' Created 3 years, 9 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" 9 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h"
10 #include "components/payments/content/payment_request.h" 10 #include "components/payments/content/payment_request.h"
11 #include "components/payments/content/payment_request_state.h"
11 12
12 namespace payments { 13 namespace payments {
13 14
14 class PaymentRequest; 15 class PaymentRequest;
15 class PaymentRequestDialogView; 16 class PaymentRequestDialogView;
16 17
17 // The PaymentRequestSheetController subtype for the Order Summary screen of the 18 // The PaymentRequestSheetController subtype for the Order Summary screen of the
18 // Payment Request flow. 19 // Payment Request flow.
19 class OrderSummaryViewController : public PaymentRequestSheetController, 20 class OrderSummaryViewController : public PaymentRequestSheetController,
20 public PaymentRequest::Observer { 21 public PaymentRequestState::Observer {
21 public: 22 public:
22 // Does not take ownership of the arguments, which should outlive this object. 23 // Does not take ownership of the arguments, which should outlive this object.
23 OrderSummaryViewController(PaymentRequest* request, 24 OrderSummaryViewController(PaymentRequest* request,
24 PaymentRequestDialogView* dialog); 25 PaymentRequestDialogView* dialog);
25 ~OrderSummaryViewController() override; 26 ~OrderSummaryViewController() override;
26 27
27 // PaymentRequestSheetController: 28 // PaymentRequestSheetController:
28 std::unique_ptr<views::View> CreateView() override; 29 std::unique_ptr<views::View> CreateView() override;
29 std::unique_ptr<views::Button> CreatePrimaryButton() override; 30 std::unique_ptr<views::Button> CreatePrimaryButton() override;
30 31
31 // PaymentRequest::Observer: 32 // PaymentRequestState::Observer:
32 void OnSelectedInformationChanged() override; 33 void OnSelectedInformationChanged() override;
33 34
34 private: 35 private:
35 void UpdatePayButtonState(bool enabled); 36 void UpdatePayButtonState(bool enabled);
36 37
37 views::Button* pay_button_; 38 views::Button* pay_button_;
38 39
39 DISALLOW_COPY_AND_ASSIGN(OrderSummaryViewController); 40 DISALLOW_COPY_AND_ASSIGN(OrderSummaryViewController);
40 }; 41 };
41 42
42 } // namespace payments 43 } // namespace payments
43 44
44 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_ 45 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_ORDER_SUMMARY_VIEW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698