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

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

Issue 2700713005: [WebPayments] Updating Shipping List to use PaymentRequestRowView (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/payments/shipping_list_view_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/shipping_list_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/shipping_list_view_controller.cc b/chrome/browser/ui/views/payments/shipping_list_view_controller.cc
index ccf6155e68b8c74d26f7b2ef537d8fedbf5a1e91..5109745f5c829e6538ab3c169bffd395055549bd 100644
--- a/chrome/browser/ui/views/payments/shipping_list_view_controller.cc
+++ b/chrome/browser/ui/views/payments/shipping_list_view_controller.cc
@@ -8,11 +8,13 @@
#include <utility>
#include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
+#include "chrome/browser/ui/views/payments/payment_request_row_view.h"
#include "chrome/browser/ui/views/payments/payment_request_views_util.h"
#include "components/payments/payment_request.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/layout/box_layout.h"
+#include "ui/views/layout/grid_layout.h"
namespace payments {
@@ -36,8 +38,8 @@ std::unique_ptr<views::View> ShippingListViewController::CreateView() {
for (auto* profile : request()->shipping_profiles()) {
// TODO(tmartino): Pass an actual locale in place of empty string.
content_view->AddChildView(
- GetShippingAddressLabel(AddressStyleType::DETAILED, std::string(),
- *profile)
+ CreateAddressRow(GetShippingAddressLabel(AddressStyleType::DETAILED,
+ std::string(), *profile))
.release());
}
@@ -49,4 +51,28 @@ std::unique_ptr<views::View> ShippingListViewController::CreateView() {
std::move(content_view));
}
+std::unique_ptr<views::Button> ShippingListViewController::CreateAddressRow(
+ std::unique_ptr<views::View> content) {
+ std::unique_ptr<PaymentRequestRowView> row =
+ base::MakeUnique<PaymentRequestRowView>(this);
+ views::GridLayout* layout = new views::GridLayout(row.get());
+ row->SetLayoutManager(layout);
+
+ layout->SetInsets(
+ kPaymentRequestRowVerticalInsets, kPaymentRequestRowHorizontalInsets,
+ kPaymentRequestRowVerticalInsets,
+ kPaymentRequestRowHorizontalInsets + kPaymentRequestRowExtraRightInset);
+
+ // Add a column listing the address.
+ views::ColumnSet* columns = layout->AddColumnSet(0);
+ columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
+ views::GridLayout::USE_PREF, 0, 0);
+
+ layout->StartRow(0, 0);
+ content->set_can_process_events_within_subtree(false);
+ layout->AddView(content.release());
+
+ return std::move(row);
+}
+
} // namespace payments
« no previous file with comments | « chrome/browser/ui/views/payments/shipping_list_view_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698