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

Unified Diff: chrome/browser/ui/views/payments/shipping_option_view_controller.cc

Issue 2759253002: [Web Payments] Implement item selection in lists. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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_,

Powered by Google App Engine
This is Rietveld 408576698