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

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

Issue 2592833002: [WebPayments] Start populating the Payment Sheet. (Closed)
Patch Set: Created 4 years 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_views_util.h
diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.h b/chrome/browser/ui/views/payments/payment_request_views_util.h
index 5d9b6b90ea1d2be6faa2ab80f572f5d8c9e03ccd..56a549a17f6d42548ef5b3ae27a36bd30d94cce2 100644
--- a/chrome/browser/ui/views/payments/payment_request_views_util.h
+++ b/chrome/browser/ui/views/payments/payment_request_views_util.h
@@ -10,17 +10,49 @@
#include "base/strings/string16.h"
namespace views {
+class VectorIconButtonDelegate;
class View;
}
namespace payments {
-// Creates a view to be displayed in the PaymentRequestDialog. |title| is the
-// text displayed on top of the dialog and |content_view| is displayed between
-// the title and the pay/cancel buttons. The returned view takes ownership of
-// |content_view|.
+enum PaymentRequestCommonTags {
sky 2017/01/04 17:24:45 enum class? Style guide encourages using enum clas
anthonyvd 2017/01/04 19:08:55 Done. This kind of makes the code messier because
+ BACK_BUTTON_TAG = 0,
+ CLOSE_BUTTON_TAG,
+ // This is the max value of tags for controls common to multiple
+ // PaymentRequest contexts. Individual screens that handle both common and
+ // specific events with tags can start their specific tags at this value.
+ PAYMENT_REQUEST_COMMON_TAG_MAX
+};
+
+// Creates and returns a header for all the sheets in the PaymentRequest dialog.
+// The header contains an optional back arrow button (if |show_back_arrow| is
+// true), a |title| label, and a right-aligned X close button. |delegate|
+// becomes the delegate for the back and close buttons.
+// +---------------------------+
+// | <- | Title | X |
please use gerrit instead 2017/01/04 15:55:27 Thank you for the ASCII diagrams. They are most he
anthonyvd 2017/01/04 19:08:55 Credit where credit is due: inspiration comes from
+// +---------------------------+
+std::unique_ptr<views::View> CreateSheetHeaderView(
+ bool show_back_arrow,
+ const base::string16& title,
+ views::VectorIconButtonDelegate* delegate);
+
+// Creates a view to be displayed in the PaymentRequestDialog.
+// |header_view| is the view displayed on top of the dialog, containing title,
+// (optional) back button, and close buttons.
+// |content_view| is displayed between |header_view| and the pay/cancel buttons.
+// The returned view takes ownership of |header_view| and |content_view|.
+// +---------------------------+
+// | HEADER VIEW |
+// +---------------------------+
+// | CONTENT |
+// | VIEW |
+// +---------------------------+
+// | | CANCEL | PAY |
+// +---------------------------+
std::unique_ptr<views::View> CreatePaymentView(
- const base::string16& title, std::unique_ptr<views::View> content_view);
+ std::unique_ptr<views::View> header_view,
+ std::unique_ptr<views::View> content_view);
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698