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

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: missed a merge problem 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 26994e2df57f078c18a11dbc2cfc8724e0120e00..f34d57d135ff7b5f22866eeb172b6711a6220ec0 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"
@@ -229,6 +230,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);
@@ -239,14 +245,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