Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_VIEWS_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 class VectorIconButtonDelegate; | |
| 13 class View; | 14 class View; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace payments { | 17 namespace payments { |
| 17 | 18 |
| 18 // Creates a view to be displayed in the PaymentRequestDialog. |title| is the | 19 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
| |
| 19 // text displayed on top of the dialog and |content_view| is displayed between | 20 BACK_BUTTON_TAG = 0, |
| 20 // the title and the pay/cancel buttons. The returned view takes ownership of | 21 CLOSE_BUTTON_TAG, |
| 21 // |content_view|. | 22 // This is the max value of tags for controls common to multiple |
| 23 // PaymentRequest contexts. Individual screens that handle both common and | |
| 24 // specific events with tags can start their specific tags at this value. | |
| 25 PAYMENT_REQUEST_COMMON_TAG_MAX | |
| 26 }; | |
| 27 | |
| 28 // Creates and returns a header for all the sheets in the PaymentRequest dialog. | |
| 29 // The header contains an optional back arrow button (if |show_back_arrow| is | |
| 30 // true), a |title| label, and a right-aligned X close button. |delegate| | |
| 31 // becomes the delegate for the back and close buttons. | |
| 32 // +---------------------------+ | |
| 33 // | <- | 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
| |
| 34 // +---------------------------+ | |
| 35 std::unique_ptr<views::View> CreateSheetHeaderView( | |
| 36 bool show_back_arrow, | |
| 37 const base::string16& title, | |
| 38 views::VectorIconButtonDelegate* delegate); | |
| 39 | |
| 40 // Creates a view to be displayed in the PaymentRequestDialog. | |
| 41 // |header_view| is the view displayed on top of the dialog, containing title, | |
| 42 // (optional) back button, and close buttons. | |
| 43 // |content_view| is displayed between |header_view| and the pay/cancel buttons. | |
| 44 // The returned view takes ownership of |header_view| and |content_view|. | |
| 45 // +---------------------------+ | |
| 46 // | HEADER VIEW | | |
| 47 // +---------------------------+ | |
| 48 // | CONTENT | | |
| 49 // | VIEW | | |
| 50 // +---------------------------+ | |
| 51 // | | CANCEL | PAY | | |
| 52 // +---------------------------+ | |
| 22 std::unique_ptr<views::View> CreatePaymentView( | 53 std::unique_ptr<views::View> CreatePaymentView( |
| 23 const base::string16& title, std::unique_ptr<views::View> content_view); | 54 std::unique_ptr<views::View> header_view, |
| 55 std::unique_ptr<views::View> content_view); | |
| 24 | 56 |
| 25 } // namespace payments | 57 } // namespace payments |
| 26 | 58 |
| 27 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 59 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| OLD | NEW |