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

Side by Side Diff: chrome/browser/ui/views/payments/shipping_option_view_controller.cc

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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "chrome/browser/ui/views/payments/shipping_option_view_controller.h" 5 #include "chrome/browser/ui/views/payments/shipping_option_view_controller.h"
6 6
7 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" 7 #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
8 #include "components/payments/content/payment_request.h" 8 #include "components/payments/content/payment_request.h"
9 9
10 namespace payments { 10 namespace payments {
(...skipping 24 matching lines...) Expand all
35 35
36 DISALLOW_COPY_AND_ASSIGN(ShippingOptionItem); 36 DISALLOW_COPY_AND_ASSIGN(ShippingOptionItem);
37 }; 37 };
38 38
39 } // namespace 39 } // namespace
40 40
41 ShippingOptionViewController::ShippingOptionViewController( 41 ShippingOptionViewController::ShippingOptionViewController(
42 PaymentRequest* request, 42 PaymentRequest* request,
43 PaymentRequestDialogView* dialog) 43 PaymentRequestDialogView* dialog)
44 : PaymentRequestSheetController(request, dialog) { 44 : PaymentRequestSheetController(request, dialog) {
45 for (const auto& option : request->details()->shipping_options) { 45 for (const auto& option : request->spec()->details().shipping_options) {
46 shipping_option_list_.AddItem(base::MakeUnique<ShippingOptionItem>( 46 shipping_option_list_.AddItem(base::MakeUnique<ShippingOptionItem>(
47 option.get(), request, &shipping_option_list_, 47 option.get(), request, &shipping_option_list_,
48 option.get() == request->selected_shipping_option())); 48 option.get() == request->state()->selected_shipping_option()));
49 } 49 }
50 } 50 }
51 51
52 ShippingOptionViewController::~ShippingOptionViewController() {} 52 ShippingOptionViewController::~ShippingOptionViewController() {}
53 53
54 std::unique_ptr<views::View> ShippingOptionViewController::CreateView() { 54 std::unique_ptr<views::View> ShippingOptionViewController::CreateView() {
55 std::unique_ptr<views::View> list_view = 55 std::unique_ptr<views::View> list_view =
56 shipping_option_list_.CreateListView(); 56 shipping_option_list_.CreateListView();
57 return CreatePaymentView( 57 return CreatePaymentView(
58 CreateSheetHeaderView( 58 CreateSheetHeaderView(true,
59 true, 59 GetShippingOptionSectionString(
60 GetShippingOptionSectionString(request()->options()->shipping_type), 60 request()->spec()->options().shipping_type),
61 this), 61 this),
62 std::move(list_view)); 62 std::move(list_view));
63 } 63 }
64 64
65 std::unique_ptr<views::View> 65 std::unique_ptr<views::View>
66 ShippingOptionViewController::CreateExtraFooterView() { 66 ShippingOptionViewController::CreateExtraFooterView() {
67 return nullptr; 67 return nullptr;
68 } 68 }
69 69
70 } // namespace payments 70 } // namespace payments
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/payments/profile_list_view_controller.cc ('k') | components/payments/content/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698