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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_item_list.h

Issue 2855203002: [Payments] Display the shipping option error alongside the address (Closed)
Patch Set: added tests Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 std::unique_ptr<views::ImageView> CreateCheckmark(bool selected); 69 std::unique_ptr<views::ImageView> CreateCheckmark(bool selected);
70 70
71 // Creates the view that represents this item's content. Typically this will 71 // Creates the view that represents this item's content. Typically this will
72 // be a label describing the payment method, shipping adress, etc. 72 // be a label describing the payment method, shipping adress, etc.
73 virtual std::unique_ptr<views::View> CreateContentView() = 0; 73 virtual std::unique_ptr<views::View> CreateContentView() = 0;
74 74
75 // Creates the view that should be displayed after the checkmark in the 75 // Creates the view that should be displayed after the checkmark in the
76 // item's view, such as the credit card icon. 76 // item's view, such as the credit card icon.
77 virtual std::unique_ptr<views::View> CreateExtraView(); 77 virtual std::unique_ptr<views::View> CreateExtraView();
78 78
79 // Whether the item should be disabled (user will not be able to click on
80 // it).
81 virtual bool IsDisabled() = 0;
82
79 // Returns whether this item is complete/valid and can be selected by the 83 // Returns whether this item is complete/valid and can be selected by the
80 // user. If this returns false when the user attempts to select this item, 84 // user. If this returns false when the user attempts to select this item,
81 // PerformSelectionFallback will be called instead. 85 // PerformSelectionFallback will be called instead.
82 virtual bool CanBeSelected() const = 0; 86 virtual bool CanBeSelected() = 0;
anthonyvd 2017/05/04 13:07:37 Why remove const?
Mathieu 2017/05/04 13:53:25 It calls IsEnabled, which calls into state(), whic
83 87
84 // Performs the action that replaces selection when CanBeSelected returns 88 // Performs the action that replaces selection when CanBeSelected returns
85 // false. This will usually be to display an editor. 89 // false. This will usually be to display an editor.
86 virtual void PerformSelectionFallback() = 0; 90 virtual void PerformSelectionFallback() = 0;
87 91
88 private: 92 private:
89 // Creates and returns the view associated with this list item. 93 // Creates and returns the view associated with this list item.
90 std::unique_ptr<views::View> CreateItemView(); 94 std::unique_ptr<views::View> CreateItemView();
91 95
92 // views::ButtonListener: 96 // views::ButtonListener:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 128
125 std::vector<std::unique_ptr<Item>> items_; 129 std::vector<std::unique_ptr<Item>> items_;
126 Item* selected_item_; 130 Item* selected_item_;
127 131
128 DISALLOW_COPY_AND_ASSIGN(PaymentRequestItemList); 132 DISALLOW_COPY_AND_ASSIGN(PaymentRequestItemList);
129 }; 133 };
130 134
131 } // namespace payments 135 } // namespace payments
132 136
133 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_ 137 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ITEM_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698