Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" | 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
| 8 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" | 8 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" |
| 9 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 9 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
| 10 #include "components/payments/content/payment_request.h" | 10 #include "components/payments/content/payment_request.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 layout->StartRow(1, 0); | 104 layout->StartRow(1, 0); |
| 105 // |content_view| will go into a views::ScrollView so it needs to be sized now | 105 // |content_view| will go into a views::ScrollView so it needs to be sized now |
| 106 // otherwise it'll be sized to the ScrollView's viewport height, preventing | 106 // otherwise it'll be sized to the ScrollView's viewport height, preventing |
| 107 // the scroll bar from ever being shown. | 107 // the scroll bar from ever being shown. |
| 108 views::View* pane = new views::View; | 108 views::View* pane = new views::View; |
| 109 views::GridLayout* pane_layout = new views::GridLayout(pane); | 109 views::GridLayout* pane_layout = new views::GridLayout(pane); |
| 110 views::ColumnSet* pane_columns = pane_layout->AddColumnSet(0); | 110 views::ColumnSet* pane_columns = pane_layout->AddColumnSet(0); |
| 111 pane_columns->AddColumn( | 111 pane_columns->AddColumn( |
| 112 views::GridLayout::Alignment::FILL, views::GridLayout::Alignment::LEADING, | 112 views::GridLayout::Alignment::FILL, views::GridLayout::Alignment::LEADING, |
| 113 0, views::GridLayout::SizeType::FIXED, kDialogWidth, kDialogWidth); | 113 0, views::GridLayout::SizeType::FIXED, kDialogWidth, kDialogWidth); |
| 114 | |
|
Mathieu
2017/04/04 19:05:48
we could revert this line and thus file
anthonyvd
2017/04/04 23:02:14
Good catch, done.
| |
| 114 pane->SetLayoutManager(pane_layout); | 115 pane->SetLayoutManager(pane_layout); |
| 115 pane_layout->StartRow(0, 0); | 116 pane_layout->StartRow(0, 0); |
| 116 pane_layout->AddView(content_view_); | 117 pane_layout->AddView(content_view_); |
| 117 pane->SizeToPreferredSize(); | 118 pane->SizeToPreferredSize(); |
| 118 | 119 |
| 119 std::unique_ptr<views::ScrollView> scroll = | 120 std::unique_ptr<views::ScrollView> scroll = |
| 120 base::MakeUnique<views::ScrollView>(); | 121 base::MakeUnique<views::ScrollView>(); |
| 121 scroll->EnableViewPortLayer(); | 122 scroll->EnableViewPortLayer(); |
| 122 scroll->set_hide_horizontal_scrollbar(true); | 123 scroll->set_hide_horizontal_scrollbar(true); |
| 123 scroll->SetContents(pane); | 124 scroll->SetContents(pane); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 button->set_tag(static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG)); | 173 button->set_tag(static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG)); |
| 173 button->set_id(static_cast<int>(DialogViewID::CANCEL_BUTTON)); | 174 button->set_id(static_cast<int>(DialogViewID::CANCEL_BUTTON)); |
| 174 trailing_buttons_container->AddChildView(button); | 175 trailing_buttons_container->AddChildView(button); |
| 175 | 176 |
| 176 layout->AddView(trailing_buttons_container.release()); | 177 layout->AddView(trailing_buttons_container.release()); |
| 177 | 178 |
| 178 return container; | 179 return container; |
| 179 } | 180 } |
| 180 | 181 |
| 181 } // namespace payments | 182 } // namespace payments |
| OLD | NEW |