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

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

Issue 2755493005: [Web Payments] Consolidate list code. (Closed)
Patch Set: Move selection logic to base. 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 053e06947f03283ab771a66a5b7437fe5bfe02f5..cbf166bcf46fa4e3fe78bb5164a96591cfa067dd 100644
--- a/chrome/browser/ui/views/payments/shipping_option_view_controller.cc
+++ b/chrome/browser/ui/views/payments/shipping_option_view_controller.cc
@@ -25,7 +25,7 @@ class ShippingOptionItem : public PaymentRequestItemList::Item {
private:
// payments::PaymentRequestItemList::Item:
- std::unique_ptr<views::View> CreateItemView() override {
+ std::unique_ptr<views::View> CreateContentView() override {
return CreateShippingOptionLabel(
shipping_option_,
spec()->GetFormattedCurrencyAmount(shipping_option_->amount->value));
@@ -33,6 +33,16 @@ class ShippingOptionItem : public PaymentRequestItemList::Item {
void SelectedStateChanged() override {}
+ bool CanBeSelected() const override {
+ // Shipping options are vetted by the website, they're all OK to select.
tmartino 2017/03/16 17:42:01 Omega nit: this should be a semicolon, not a comma
anthonyvd 2017/03/20 13:24:59 Done!
+ return true;
+ }
+
+ void PerformSelectionFallback() override {
+ // Since CanBeSelected() is always true, this should never be called.
+ NOTREACHED();
+ }
+
mojom::PaymentShippingOption* shipping_option_;
DISALLOW_COPY_AND_ASSIGN(ShippingOptionItem);

Powered by Google App Engine
This is Rietveld 408576698