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

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

Issue 2747943004: [Web Payments] Add the shipping options sheet. (Closed)
Patch Set: Address comments. Created 3 years, 9 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_views_util.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.cc b/chrome/browser/ui/views/payments/payment_request_views_util.cc
index dd9a83e562874057b3874c22804e05ee8d713bdc..4e3a9b4472eac73039ff9a20c896fbeeb414ea34 100644
--- a/chrome/browser/ui/views/payments/payment_request_views_util.cc
+++ b/chrome/browser/ui/views/payments/payment_request_views_util.cc
@@ -277,4 +277,24 @@ base::string16 GetShippingOptionSectionString(
return l10n_util::GetStringUTF16(IDS_PAYMENTS_SHIPPING_OPTION_LABEL);
}
+std::unique_ptr<views::View> CreateShippingOptionLabel(
+ payments::mojom::PaymentShippingOption* shipping_option,
+ const base::string16& formatted_amount) {
+ std::unique_ptr<views::View> container = base::MakeUnique<views::View>();
+
+ std::unique_ptr<views::BoxLayout> layout =
+ base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 0, 0, 0);
+ layout->set_cross_axis_alignment(
+ views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
+ container->SetLayoutManager(layout.release());
+
+ if (shipping_option) {
+ container->AddChildView(
+ new views::Label(base::ASCIIToUTF16(shipping_option->label)));
+ container->AddChildView(new views::Label(formatted_amount));
+ }
+
+ return container;
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698