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

Unified Diff: chrome/browser/ui/views/payments/payment_request_item_list.h

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/payment_request_item_list.h
diff --git a/chrome/browser/ui/views/payments/payment_request_item_list.h b/chrome/browser/ui/views/payments/payment_request_item_list.h
index 7a2ecc3f3eb8ecd194c0e68fc058a1106463a0e4..baed2924c6a85f19b75ea76c022f34aed5c8c1cf 100644
--- a/chrome/browser/ui/views/payments/payment_request_item_list.h
+++ b/chrome/browser/ui/views/payments/payment_request_item_list.h
@@ -58,9 +58,6 @@ class PaymentRequestItemList {
PaymentRequestState* state() { return state_; }
protected:
- // Creates and returns the view associated with this list item.
- virtual std::unique_ptr<views::View> CreateItemView() = 0;
-
// Called when the selected state of this item changes. Subclasses may
// assume that they are the only selected item in |list| when this is
// called. This could be called before CreateItemView so subclasses should
@@ -71,15 +68,24 @@ class PaymentRequestItemList {
// selected.
std::unique_ptr<views::ImageView> CreateCheckmark(bool selected);
+ virtual std::unique_ptr<views::View> CreateContentView() = 0;
+ virtual std::unique_ptr<views::View> CreateExtraView();
+
+ virtual bool CanBeSelected() const = 0;
+ virtual void PerformSelectionFallback() = 0;
+
private:
+ // Creates and returns the view associated with this list item.
+ std::unique_ptr<views::View> CreateItemView();
+
// views::ButtonListener:
- void ButtonPressed(views::Button* sender, const ui::Event& event) override {
- }
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
std::unique_ptr<views::View> item_view_;
PaymentRequestSpec* spec_;
PaymentRequestState* state_;
PaymentRequestItemList* list_;
+ std::unique_ptr<views::ImageView> checkmark_;
bool selected_;
DISALLOW_COPY_AND_ASSIGN(Item);

Powered by Google App Engine
This is Rietveld 408576698