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

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

Issue 2872623002: [Web Payments] Add "pencil" edit button to lists. (Closed)
Patch Set: Move and rename icon. 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 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 dee0a8a6855489b2f651e075e9ef95d4769a55e2..2673ecc26bb98e199e3d8b22fd8fc91e42640d38 100644
--- a/chrome/browser/ui/views/payments/payment_request_item_list.h
+++ b/chrome/browser/ui/views/payments/payment_request_item_list.h
@@ -12,6 +12,7 @@
#include "ui/views/controls/button/button.h"
namespace views {
+class ImageButton;
class ImageView;
class View;
}
@@ -36,7 +37,8 @@ class PaymentRequestItemList {
Item(PaymentRequestSpec* spec,
PaymentRequestState* state,
PaymentRequestItemList* list,
- bool selected);
+ bool selected,
+ bool show_edit_button);
~Item() override;
// Gets the view associated with this item. It's owned by this object so
@@ -89,6 +91,10 @@ class PaymentRequestItemList {
// false. This will usually be to display an editor.
virtual void PerformSelectionFallback() = 0;
+ // Called when the edit button is pressed. Subclasses should open the editor
+ // appropriate for the item they represent.
+ virtual void EditButtonPressed() = 0;
+
private:
// Creates and returns the view associated with this list item.
std::unique_ptr<views::View> CreateItemView();
@@ -101,7 +107,9 @@ class PaymentRequestItemList {
PaymentRequestState* state_;
PaymentRequestItemList* list_;
std::unique_ptr<views::ImageView> checkmark_;
+ std::unique_ptr<views::ImageButton> edit_button_;
sky 2017/05/12 01:28:48 I think a better approach here is to not have the
bool selected_;
+ bool show_edit_button_;
DISALLOW_COPY_AND_ASSIGN(Item);
};

Powered by Google App Engine
This is Rietveld 408576698