| 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 constexpr int kPaymentRequestRowHorizontalInsets = 16; | 31 constexpr int kPaymentRequestRowHorizontalInsets = 16; |
| 32 constexpr int kPaymentRequestRowVerticalInsets = 8; | 32 constexpr int kPaymentRequestRowVerticalInsets = 8; |
| 33 | 33 |
| 34 // Extra inset relative to the header when a right edge should line up with the | 34 // Extra inset relative to the header when a right edge should line up with the |
| 35 // close button's X rather than its invisible right edge. | 35 // close button's X rather than its invisible right edge. |
| 36 constexpr int kPaymentRequestRowExtraRightInset = 8; | 36 constexpr int kPaymentRequestRowExtraRightInset = 8; |
| 37 constexpr int kPaymentRequestButtonSpacing = 10; | 37 constexpr int kPaymentRequestButtonSpacing = 10; |
| 38 | 38 |
| 39 // Dimensions of the dialog itself. | 39 // Dimensions of the dialog itself. |
| 40 constexpr int kDialogWidth = 450; | |
| 41 constexpr int kDialogHeight = 450; | 40 constexpr int kDialogHeight = 450; |
| 42 | 41 |
| 43 enum class PaymentRequestCommonTags { | 42 enum class PaymentRequestCommonTags { |
| 44 BACK_BUTTON_TAG = 0, | 43 BACK_BUTTON_TAG = 0, |
| 45 CLOSE_BUTTON_TAG, | 44 CLOSE_BUTTON_TAG, |
| 46 PAY_BUTTON_TAG, | 45 PAY_BUTTON_TAG, |
| 47 // This is the max value of tags for controls common to multiple | 46 // This is the max value of tags for controls common to multiple |
| 48 // PaymentRequest contexts. Individual screens that handle both common and | 47 // PaymentRequest contexts. Individual screens that handle both common and |
| 49 // specific events with tags can start their specific tags at this value. | 48 // specific events with tags can start their specific tags at this value. |
| 50 PAYMENT_REQUEST_COMMON_TAG_MAX | 49 PAYMENT_REQUEST_COMMON_TAG_MAX |
| 51 }; | 50 }; |
| 52 | 51 |
| 52 int GetActualDialogWidth(); |
| 53 |
| 53 // Creates and returns a header for all the sheets in the PaymentRequest dialog. | 54 // Creates and returns a header for all the sheets in the PaymentRequest dialog. |
| 54 // The header contains an optional back arrow button (if |show_back_arrow| is | 55 // The header contains an optional back arrow button (if |show_back_arrow| is |
| 55 // true), a |title| label. |delegate| becomes the delegate for the back and | 56 // true), a |title| label. |delegate| becomes the delegate for the back and |
| 56 // close buttons. | 57 // close buttons. |
| 57 // +---------------------------+ | 58 // +---------------------------+ |
| 58 // | <- | Title | | 59 // | <- | Title | |
| 59 // +---------------------------+ | 60 // +---------------------------+ |
| 60 std::unique_ptr<views::View> CreateSheetHeaderView( | 61 std::unique_ptr<views::View> CreateSheetHeaderView( |
| 61 bool show_back_arrow, | 62 bool show_back_arrow, |
| 62 const base::string16& title, | 63 const base::string16& title, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Creates a label with a bold font. | 99 // Creates a label with a bold font. |
| 99 std::unique_ptr<views::Label> CreateBoldLabel(const base::string16& text); | 100 std::unique_ptr<views::Label> CreateBoldLabel(const base::string16& text); |
| 100 | 101 |
| 101 std::unique_ptr<views::View> CreateShippingOptionLabel( | 102 std::unique_ptr<views::View> CreateShippingOptionLabel( |
| 102 payments::mojom::PaymentShippingOption* shipping_option, | 103 payments::mojom::PaymentShippingOption* shipping_option, |
| 103 const base::string16& formatted_amount); | 104 const base::string16& formatted_amount); |
| 104 | 105 |
| 105 } // namespace payments | 106 } // namespace payments |
| 106 | 107 |
| 107 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ | 108 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ |
| OLD | NEW |