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

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

Issue 2779283002: [Web Payments] Implement the CVC Unmask dialog. (Closed)
Patch Set: Update AutofillPaymentInstrument's credit_card_ after unmasking. 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 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 layout->StartRow(0, 0); 98 layout->StartRow(0, 0);
99 // |header_view| will be deleted when |view| is. 99 // |header_view| will be deleted when |view| is.
100 layout->AddView( 100 layout->AddView(
101 CreateSheetHeaderView(ShouldShowHeaderBackArrow(), GetSheetTitle(), this) 101 CreateSheetHeaderView(ShouldShowHeaderBackArrow(), GetSheetTitle(), this)
102 .release()); 102 .release());
103 103
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 content_view_->SizeToPreferredSize(); 108 views::View* pane = new views::View;
109 views::GridLayout* pane_layout = new views::GridLayout(pane);
110 views::ColumnSet* pane_columns = pane_layout->AddColumnSet(0);
111 pane_columns->AddColumn(views::GridLayout::Alignment::FILL,
112 views::GridLayout::Alignment::LEADING, 0,
113 views::GridLayout::SizeType::FIXED, 450, 450);
114 pane->SetLayoutManager(pane_layout);
115 pane_layout->StartRow(0, 0);
116 pane_layout->AddView(content_view_);
117 pane->SizeToPreferredSize();
109 118
110 std::unique_ptr<views::ScrollView> scroll = 119 std::unique_ptr<views::ScrollView> scroll =
111 base::MakeUnique<views::ScrollView>(); 120 base::MakeUnique<views::ScrollView>();
112 scroll->EnableViewPortLayer(); 121 scroll->EnableViewPortLayer();
113 scroll->set_hide_horizontal_scrollbar(true); 122 scroll->set_hide_horizontal_scrollbar(true);
114 scroll->SetContents(content_view_); 123 scroll->SetContents(pane);
115 layout->AddView(scroll.release()); 124 layout->AddView(scroll.release());
116 125
117 layout->StartRow(0, 0); 126 layout->StartRow(0, 0);
118 layout->AddView(CreateFooterView().release()); 127 layout->AddView(CreateFooterView().release());
119 128
120 return view; 129 return view;
121 } 130 }
122 131
123 std::unique_ptr<views::View> PaymentRequestSheetController::CreateFooterView() { 132 std::unique_ptr<views::View> PaymentRequestSheetController::CreateFooterView() {
124 std::unique_ptr<views::View> container = base::MakeUnique<views::View>(); 133 std::unique_ptr<views::View> container = base::MakeUnique<views::View>();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 button->set_tag(static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG)); 172 button->set_tag(static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG));
164 button->set_id(static_cast<int>(DialogViewID::CANCEL_BUTTON)); 173 button->set_id(static_cast<int>(DialogViewID::CANCEL_BUTTON));
165 trailing_buttons_container->AddChildView(button); 174 trailing_buttons_container->AddChildView(button);
166 175
167 layout->AddView(trailing_buttons_container.release()); 176 layout->AddView(trailing_buttons_container.release());
168 177
169 return container; 178 return container;
170 } 179 }
171 180
172 } // namespace payments 181 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698