| OLD | NEW |
| 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_dialog_view.h" | 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
| 8 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 8 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
| 9 #include "components/payments/content/payment_request_spec.h" | 9 #include "components/payments/content/payment_request_spec.h" |
| 10 #include "components/payments/content/payment_request_state.h" | 10 #include "components/payments/content/payment_request_state.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 : PaymentRequestSheetController(spec, state, dialog) { | 66 : PaymentRequestSheetController(spec, state, dialog) { |
| 67 for (const auto& option : spec->details().shipping_options) { | 67 for (const auto& option : spec->details().shipping_options) { |
| 68 shipping_option_list_.AddItem(base::MakeUnique<ShippingOptionItem>( | 68 shipping_option_list_.AddItem(base::MakeUnique<ShippingOptionItem>( |
| 69 option.get(), spec, state, &shipping_option_list_, dialog, | 69 option.get(), spec, state, &shipping_option_list_, dialog, |
| 70 option.get() == state->selected_shipping_option())); | 70 option.get() == state->selected_shipping_option())); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 ShippingOptionViewController::~ShippingOptionViewController() {} | 74 ShippingOptionViewController::~ShippingOptionViewController() {} |
| 75 | 75 |
| 76 std::unique_ptr<views::View> ShippingOptionViewController::CreateView() { | 76 base::string16 ShippingOptionViewController::GetSheetTitle() { |
| 77 std::unique_ptr<views::View> list_view = | 77 return GetShippingOptionSectionString(spec()->options().shipping_type); |
| 78 shipping_option_list_.CreateListView(); | 78 } |
| 79 return CreatePaymentView( | 79 |
| 80 CreateSheetHeaderView( | 80 void ShippingOptionViewController::FillContentView(views::View* content_view) { |
| 81 true, GetShippingOptionSectionString(spec()->options().shipping_type), | 81 content_view->AddChildView(shipping_option_list_.CreateListView().release()); |
| 82 this), | |
| 83 std::move(list_view)); | |
| 84 } | 82 } |
| 85 | 83 |
| 86 std::unique_ptr<views::View> | 84 std::unique_ptr<views::View> |
| 87 ShippingOptionViewController::CreateExtraFooterView() { | 85 ShippingOptionViewController::CreateExtraFooterView() { |
| 88 return nullptr; | 86 return nullptr; |
| 89 } | 87 } |
| 90 | 88 |
| 91 } // namespace payments | 89 } // namespace payments |
| OLD | NEW |