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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_sheet_controller.cc

Issue 2846053002: [Web Payments] Respect Harmony dialog width in Payment Request (Closed)
Patch Set: Change the dialog to Large 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 unified diff | Download patch
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 CreateSheetHeaderView(ShouldShowHeaderBackArrow(), GetSheetTitle(), this) 102 CreateSheetHeaderView(ShouldShowHeaderBackArrow(), GetSheetTitle(), this)
103 .release()); 103 .release());
104 104
105 layout->StartRow(1, 0); 105 layout->StartRow(1, 0);
106 // |content_view| will go into a views::ScrollView so it needs to be sized now 106 // |content_view| will go into a views::ScrollView so it needs to be sized now
107 // otherwise it'll be sized to the ScrollView's viewport height, preventing 107 // otherwise it'll be sized to the ScrollView's viewport height, preventing
108 // the scroll bar from ever being shown. 108 // the scroll bar from ever being shown.
109 pane_ = new views::View; 109 pane_ = new views::View;
110 views::GridLayout* pane_layout = new views::GridLayout(pane_); 110 views::GridLayout* pane_layout = new views::GridLayout(pane_);
111 views::ColumnSet* pane_columns = pane_layout->AddColumnSet(0); 111 views::ColumnSet* pane_columns = pane_layout->AddColumnSet(0);
112 pane_columns->AddColumn( 112 pane_columns->AddColumn(views::GridLayout::Alignment::FILL,
113 views::GridLayout::Alignment::FILL, views::GridLayout::Alignment::LEADING, 113 views::GridLayout::Alignment::LEADING, 0,
114 0, views::GridLayout::SizeType::FIXED, kDialogWidth, kDialogWidth); 114 views::GridLayout::SizeType::FIXED,
115 GetActualDialogWidth(), GetActualDialogWidth());
115 pane_->SetLayoutManager(pane_layout); 116 pane_->SetLayoutManager(pane_layout);
116 pane_layout->StartRow(0, 0); 117 pane_layout->StartRow(0, 0);
117 // This is owned by its parent. It's the container passed to FillContentView. 118 // This is owned by its parent. It's the container passed to FillContentView.
118 content_view_ = new views::View; 119 content_view_ = new views::View;
119 pane_layout->AddView(content_view_); 120 pane_layout->AddView(content_view_);
120 pane_->SizeToPreferredSize(); 121 pane_->SizeToPreferredSize();
121 122
122 scroll_ = base::MakeUnique<views::ScrollView>(); 123 scroll_ = base::MakeUnique<views::ScrollView>();
123 scroll_->set_owned_by_client(); 124 scroll_->set_owned_by_client();
124 scroll_->EnableViewPortLayer(); 125 scroll_->EnableViewPortLayer();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 button->set_tag(static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG)); 176 button->set_tag(static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG));
176 button->set_id(static_cast<int>(DialogViewID::CANCEL_BUTTON)); 177 button->set_id(static_cast<int>(DialogViewID::CANCEL_BUTTON));
177 trailing_buttons_container->AddChildView(button); 178 trailing_buttons_container->AddChildView(button);
178 179
179 layout->AddView(trailing_buttons_container.release()); 180 layout->AddView(trailing_buttons_container.release());
180 181
181 return container; 182 return container;
182 } 183 }
183 184
184 } // namespace payments 185 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698