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

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

Issue 2715213005: [Payments] Add the pay button, and control its enabled state (Closed)
Patch Set: addressed comments 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_PAYMENT_SHEET_VIEW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" 11 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h"
12 #include "components/payments/content/payment_request.h"
12 13
13 namespace payments { 14 namespace payments {
14 15
15 class PaymentRequest; 16 class PaymentRequest;
16 class PaymentRequestDialogView; 17 class PaymentRequestDialogView;
17 18
18 // The PaymentRequestSheetController subtype for the Payment Sheet screen of the 19 // The PaymentRequestSheetController subtype for the Payment Sheet screen of the
19 // Payment Request dialog. 20 // Payment Request dialog.
20 class PaymentSheetViewController : public PaymentRequestSheetController { 21 class PaymentSheetViewController : public PaymentRequestSheetController,
22 public PaymentRequest::Observer {
21 public: 23 public:
22 // Does not take ownership of the arguments, which should outlive this object. 24 // Does not take ownership of the arguments, which should outlive this object.
23 PaymentSheetViewController(PaymentRequest* request, 25 PaymentSheetViewController(PaymentRequest* request,
24 PaymentRequestDialogView* dialog); 26 PaymentRequestDialogView* dialog);
25 ~PaymentSheetViewController() override; 27 ~PaymentSheetViewController() override;
26 28
27 // PaymentRequestSheetController: 29 // PaymentRequestSheetController:
28 std::unique_ptr<views::View> CreateView() override; 30 std::unique_ptr<views::View> CreateView() override;
31 std::unique_ptr<views::Button> CreatePrimaryButton() override;
32
33 // PaymentRequest::Observer:
34 void OnSelectedInformationChanged() override;
29 35
30 private: 36 private:
31 // PaymentRequestSheetController: 37 // PaymentRequestSheetController:
32 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 38 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
33 39
40 void UpdatePayButtonState(bool enabled);
41
34 std::unique_ptr<views::View> CreateOrderSummarySectionContent(); 42 std::unique_ptr<views::View> CreateOrderSummarySectionContent();
35 std::unique_ptr<views::View> CreateShippingSectionContent(); 43 std::unique_ptr<views::View> CreateShippingSectionContent();
36 std::unique_ptr<views::Button> CreateShippingRow(); 44 std::unique_ptr<views::Button> CreateShippingRow();
37 std::unique_ptr<views::Button> CreatePaymentSheetSummaryRow(); 45 std::unique_ptr<views::Button> CreatePaymentSheetSummaryRow();
38 std::unique_ptr<views::Button> CreatePaymentMethodRow(); 46 std::unique_ptr<views::Button> CreatePaymentMethodRow();
39 std::unique_ptr<views::View> CreateContactInfoSectionContent(); 47 std::unique_ptr<views::View> CreateContactInfoSectionContent();
40 std::unique_ptr<views::Button> CreateContactInfoRow(); 48 std::unique_ptr<views::Button> CreateContactInfoRow();
41 49
50 views::Button* pay_button_;
51
42 const int widest_name_column_view_width_; 52 const int widest_name_column_view_width_;
43 53
44 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewController); 54 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewController);
45 }; 55 };
46 56
47 } // namespace payments 57 } // namespace payments
48 58
49 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_ 59 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_SHEET_VIEW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698