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

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

Issue 2859193004: Remove GridLayout::SetInsets in favor of an empty border on the host. (Closed)
Patch Set: fix compile and tests Created 3 years, 7 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_sheet_controller.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
index ae2dfa5e576bce39738dfc04e835b58543a54603..17f2e40bdb4b40816a46ff5c1767c92a75ac4fcd 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -10,6 +10,7 @@
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/background.h"
+#include "ui/views/border.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/focus/focus_search.h"
@@ -225,6 +226,11 @@ void PaymentRequestSheetController::ButtonPressed(views::Button* sender,
std::unique_ptr<views::View> PaymentRequestSheetController::CreateFooterView() {
std::unique_ptr<views::View> container = base::MakeUnique<views::View>();
+ // The distance between the elements and the dialog borders.
+ constexpr int kInset = 16;
+ container->SetBorder(
+ views::CreateEmptyBorder(kInset, kInset, kInset, kInset));
+
views::GridLayout* layout = new views::GridLayout(container.get());
container->SetLayoutManager(layout);
@@ -235,14 +241,6 @@ std::unique_ptr<views::View> PaymentRequestSheetController::CreateFooterView() {
columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER,
0, views::GridLayout::USE_PREF, 0, 0);
- // The horizontal distance between the right/left edges of the dialog and the
- // elements.
- constexpr int kFooterHorizontalInset = 16;
- // The vertical distance between footer elements and the top/bottom border
- // (the bottom border is the edge of the dialog).
- constexpr int kFooterVerticalInset = 16;
- layout->SetInsets(kFooterVerticalInset, kFooterHorizontalInset,
- kFooterVerticalInset, kFooterHorizontalInset);
layout->StartRow(0, 0);
std::unique_ptr<views::View> extra_view = CreateExtraFooterView();
if (extra_view)

Powered by Google App Engine
This is Rietveld 408576698