Chromium Code Reviews| Index: chrome/browser/ui/views/payments/shipping_option_view_controller.cc |
| diff --git a/chrome/browser/ui/views/payments/shipping_option_view_controller.cc b/chrome/browser/ui/views/payments/shipping_option_view_controller.cc |
| index 19194f3e45a43f19a734a893964a8bfbef95b9a9..70dc665a63e8773bc6399d38c94e895b6bae05c2 100644 |
| --- a/chrome/browser/ui/views/payments/shipping_option_view_controller.cc |
| +++ b/chrome/browser/ui/views/payments/shipping_option_view_controller.cc |
| @@ -31,7 +31,10 @@ class ShippingOptionItem : public PaymentRequestItemList::Item { |
| spec()->GetFormattedCurrencyAmount(shipping_option_->amount->value)); |
| } |
| - void SelectedStateChanged() override {} |
| + void SelectedStateChanged() override { |
|
Mathieu
2017/03/21 13:56:59
We always seem to use SelectedStateChanged + selec
anthonyvd
2017/03/21 14:56:06
Yeah I thought about this too. I think it just hap
|
| + if (selected()) |
| + state()->SetSelectedShippingOption(shipping_option_); |
| + } |
| bool CanBeSelected() const override { |
| // Shipping options are vetted by the website; they're all OK to select. |
| @@ -54,7 +57,8 @@ ShippingOptionViewController::ShippingOptionViewController( |
| PaymentRequestSpec* spec, |
| PaymentRequestState* state, |
| PaymentRequestDialogView* dialog) |
| - : PaymentRequestSheetController(spec, state, dialog) { |
| + : PaymentRequestSheetController(spec, state, dialog), |
| + shipping_option_list_(dialog) { |
| for (const auto& option : spec->details().shipping_options) { |
| shipping_option_list_.AddItem(base::MakeUnique<ShippingOptionItem>( |
| option.get(), spec, state, &shipping_option_list_, |