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

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

Issue 2844483002: [Web Payments] Fix some ScrollView issues in the dialog. (Closed)
Patch Set: Created 3 years, 8 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/payment_request_sheet_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/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 894156103be555dd21c49cc3bfb570e2eb29979e..c77fc39c04034cecbf08c328b54fbd72b1a6c690 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -41,6 +41,9 @@ void PaymentRequestSheetController::UpdateContentView() {
FillContentView(content_view_);
content_view_->Layout();
pane_->SizeToPreferredSize();
+ // Now that the content and its surrounding pane are updated, force a Layout
+ // on the ScrollView so that it updates its scroll bars now.
+ scroll_->Layout();
}
std::unique_ptr<views::Button>
@@ -117,12 +120,12 @@ PaymentRequestSheetController::CreatePaymentView() {
pane_layout->AddView(content_view_);
pane_->SizeToPreferredSize();
- std::unique_ptr<views::ScrollView> scroll =
- base::MakeUnique<views::ScrollView>();
- scroll->EnableViewPortLayer();
- scroll->set_hide_horizontal_scrollbar(true);
- scroll->SetContents(pane_);
- layout->AddView(scroll.release());
+ scroll_ = base::MakeUnique<views::ScrollView>();
+ scroll_->set_owned_by_client();
+ scroll_->EnableViewPortLayer();
+ scroll_->set_hide_horizontal_scrollbar(true);
+ scroll_->SetContents(pane_);
+ layout->AddView(scroll_.get());
layout->StartRow(0, 0);
layout->AddView(CreateFooterView().release());
« no previous file with comments | « chrome/browser/ui/views/payments/payment_request_sheet_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698