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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 : PaymentRequestSheetController(spec, state, dialog) { | 68 : PaymentRequestSheetController(spec, state, dialog) { |
69 for (const auto& option : spec->details().shipping_options) { | 69 for (const auto& option : spec->details().shipping_options) { |
70 shipping_option_list_.AddItem(base::MakeUnique<ShippingOptionItem>( | 70 shipping_option_list_.AddItem(base::MakeUnique<ShippingOptionItem>( |
71 option.get(), spec, state, &shipping_option_list_, dialog, | 71 option.get(), spec, state, &shipping_option_list_, dialog, |
72 option.get() == spec->selected_shipping_option())); | 72 option.get() == spec->selected_shipping_option())); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 ShippingOptionViewController::~ShippingOptionViewController() {} | 76 ShippingOptionViewController::~ShippingOptionViewController() {} |
77 | 77 |
| 78 void ShippingOptionViewController::OnSpecUpdated() { |
| 79 UpdateContentView(); |
| 80 } |
| 81 |
78 base::string16 ShippingOptionViewController::GetSheetTitle() { | 82 base::string16 ShippingOptionViewController::GetSheetTitle() { |
79 return GetShippingOptionSectionString(spec()->shipping_type()); | 83 return GetShippingOptionSectionString(spec()->shipping_type()); |
80 } | 84 } |
81 | 85 |
82 void ShippingOptionViewController::FillContentView(views::View* content_view) { | 86 void ShippingOptionViewController::FillContentView(views::View* content_view) { |
83 content_view->SetLayoutManager(new views::FillLayout); | 87 content_view->SetLayoutManager(new views::FillLayout); |
84 content_view->AddChildView(shipping_option_list_.CreateListView().release()); | 88 content_view->AddChildView(shipping_option_list_.CreateListView().release()); |
85 } | 89 } |
86 | 90 |
87 std::unique_ptr<views::View> | 91 std::unique_ptr<views::View> |
88 ShippingOptionViewController::CreateExtraFooterView() { | 92 ShippingOptionViewController::CreateExtraFooterView() { |
89 return nullptr; | 93 return nullptr; |
90 } | 94 } |
91 | 95 |
92 } // namespace payments | 96 } // namespace payments |
OLD | NEW |