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

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

Issue 2668063003: [Web Payments] Add Cancel button to all sheets (Closed)
Patch Set: Rebase Created 3 years, 10 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 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 28 matching lines...) Expand all
39 // true), a |title| label, and a right-aligned X close button. |delegate| 39 // true), a |title| label, and a right-aligned X close button. |delegate|
40 // becomes the delegate for the back and close buttons. 40 // becomes the delegate for the back and close buttons.
41 // +---------------------------+ 41 // +---------------------------+
42 // | <- | Title | X | 42 // | <- | Title | X |
43 // +---------------------------+ 43 // +---------------------------+
44 std::unique_ptr<views::View> CreateSheetHeaderView( 44 std::unique_ptr<views::View> CreateSheetHeaderView(
45 bool show_back_arrow, 45 bool show_back_arrow,
46 const base::string16& title, 46 const base::string16& title,
47 views::VectorIconButtonDelegate* delegate); 47 views::VectorIconButtonDelegate* delegate);
48 48
49 // Creates a view to be displayed in the PaymentRequestDialog.
50 // |header_view| is the view displayed on top of the dialog, containing title,
51 // (optional) back button, and close buttons.
52 // |content_view| is displayed between |header_view| and the pay/cancel buttons.
53 // The returned view takes ownership of |header_view| and |content_view|.
54 // +---------------------------+
55 // | HEADER VIEW |
56 // +---------------------------+
57 // | CONTENT |
58 // | VIEW |
59 // +---------------------------+
60 // | | CANCEL | PAY |
61 // +---------------------------+
62 std::unique_ptr<views::View> CreatePaymentView(
63 std::unique_ptr<views::View> header_view,
64 std::unique_ptr<views::View> content_view);
65
66 // Represents formatting options for each of the different contexts in which an 49 // Represents formatting options for each of the different contexts in which an
67 // Address label may be displayed. 50 // Address label may be displayed.
68 enum class AddressStyleType { SUMMARY, DETAILED }; 51 enum class AddressStyleType { SUMMARY, DETAILED };
69 52
70 // Extracts and formats descriptive text from the given |profile| to represent 53 // Extracts and formats descriptive text from the given |profile| to represent
71 // the address in the context specified by |type|. 54 // the address in the context specified by |type|.
72 std::unique_ptr<views::View> GetShippingAddressLabel( 55 std::unique_ptr<views::View> GetShippingAddressLabel(
73 AddressStyleType type, 56 AddressStyleType type,
74 const std::string& locale, 57 const std::string& locale,
75 const autofill::AutofillProfile& profile); 58 const autofill::AutofillProfile& profile);
76 59
77 // Extracts and formats descriptive text from the given |profile| to represent 60 // Extracts and formats descriptive text from the given |profile| to represent
78 // the contact info in the context specified by |type|. Includes/excludes name, 61 // the contact info in the context specified by |type|. Includes/excludes name,
79 // email, and phone fields according to the respective boolean fields. 62 // email, and phone fields according to the respective boolean fields.
80 std::unique_ptr<views::View> GetContactInfoLabel( 63 std::unique_ptr<views::View> GetContactInfoLabel(
81 AddressStyleType type, 64 AddressStyleType type,
82 const std::string& locale, 65 const std::string& locale,
83 const autofill::AutofillProfile& profile, 66 const autofill::AutofillProfile& profile,
84 bool show_payer_name, 67 bool show_payer_name,
85 bool show_payer_email, 68 bool show_payer_email,
86 bool show_payer_phone); 69 bool show_payer_phone);
87 70
88 // Creates a views::Border object that can paint the gray horizontal ruler used 71 // Creates a views::Border object that can paint the gray horizontal ruler used
89 // as a separator between items in the Payment Request dialog. 72 // as a separator between items in the Payment Request dialog.
90 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder(); 73 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder();
91 74
92 } // namespace payments 75 } // namespace payments
93 76
94 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_ 77 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_VIEWS_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698