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

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

Issue 2722183005: [Web Payments] Wrap each sheet's content view in a scrollable view. (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 | « no previous file | chrome/browser/ui/views/payments/payment_sheet_view_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4cbaf9696cbbd59dcf720569f26eeeb3d8f558c8..6eb407d84f452aa11365a588fffdbc33bd673a5e 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -11,6 +11,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/md_text_button.h"
+#include "ui/views/controls/scroll_view.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/grid_layout.h"
@@ -64,18 +65,26 @@ std::unique_ptr<views::View> PaymentRequestSheetController::CreatePaymentView(
// Note: each view is responsible for its own padding (insets).
views::ColumnSet* columns = layout->AddColumnSet(0);
- columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER,
- 1, views::GridLayout::USE_PREF, 0, 0);
+ columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
+ views::GridLayout::USE_PREF, 0, 0);
layout->StartRow(0, 0);
// |header_view| will be deleted when |view| is.
layout->AddView(header_view.release());
- layout->StartRow(0, 0);
- // |content_view| will be deleted when |view| is.
- layout->AddView(content_view.release());
+ layout->StartRow(1, 0);
+ // |content_view| will go into a views::ScrollView so it needs to be sized now
+ // otherwise it'll be sized to the ScrollView's viewport height, preventing
+ // the scroll bar from ever being shown.
+ content_view->SizeToPreferredSize();
+
+ std::unique_ptr<views::ScrollView> scroll =
+ base::MakeUnique<views::ScrollView>();
+ scroll->EnableViewPortLayer();
+ scroll->set_hide_horizontal_scrollbar(true);
+ scroll->SetContents(content_view.release());
+ layout->AddView(scroll.release());
- layout->AddPaddingRow(1, 0);
layout->StartRow(0, 0);
layout->AddView(CreateFooterView().release());
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_sheet_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698