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

Unified Diff: chrome/browser/ui/views/payments/payment_method_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/payment_method_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
index e940bb7178cf2f3e54660397f78408f9993c07c8..f98e296258eb3a36c840a6ae59e31c8f90afc80d 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
@@ -84,7 +84,8 @@ class PaymentMethodListItem : public payments::PaymentRequestItemList::Item {
}
void SelectedStateChanged() override {
- state()->SetSelectedInstrument(instrument_);
+ if (selected())
+ state()->SetSelectedInstrument(instrument_);
}
bool CanBeSelected() const override {
@@ -108,7 +109,8 @@ PaymentMethodViewController::PaymentMethodViewController(
PaymentRequestSpec* spec,
PaymentRequestState* state,
PaymentRequestDialogView* dialog)
- : PaymentRequestSheetController(spec, state, dialog) {
+ : PaymentRequestSheetController(spec, state, dialog),
+ payment_method_list_(dialog) {
const std::vector<std::unique_ptr<PaymentInstrument>>& available_instruments =
state->available_instruments();

Powered by Google App Engine
This is Rietveld 408576698