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

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

Issue 2724063002: [Payments] Add a Pay button in the Order summary screen (Closed)
Patch Set: Initial Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_sheet_view_controller.h" 5 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 PaymentSheetViewController::PaymentSheetViewController( 165 PaymentSheetViewController::PaymentSheetViewController(
166 PaymentRequest* request, 166 PaymentRequest* request,
167 PaymentRequestDialogView* dialog) 167 PaymentRequestDialogView* dialog)
168 : PaymentRequestSheetController(request, dialog), 168 : PaymentRequestSheetController(request, dialog),
169 pay_button_(nullptr), 169 pay_button_(nullptr),
170 widest_name_column_view_width_(ComputeWidestNameColumnViewWidth()) { 170 widest_name_column_view_width_(ComputeWidestNameColumnViewWidth()) {
171 request->AddObserver(this); 171 request->AddObserver(this);
172 } 172 }
173 173
174 PaymentSheetViewController::~PaymentSheetViewController() {} 174 PaymentSheetViewController::~PaymentSheetViewController() {
175 request()->RemoveObserver(this);
176 }
175 177
176 std::unique_ptr<views::View> PaymentSheetViewController::CreateView() { 178 std::unique_ptr<views::View> PaymentSheetViewController::CreateView() {
177 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>(); 179 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
178 180
179 views::GridLayout* layout = new views::GridLayout(content_view.get()); 181 views::GridLayout* layout = new views::GridLayout(content_view.get());
180 content_view->SetLayoutManager(layout); 182 content_view->SetLayoutManager(layout);
181 views::ColumnSet* columns = layout->AddColumnSet(0); 183 views::ColumnSet* columns = layout->AddColumnSet(0);
182 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 184 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER,
183 1, views::GridLayout::USE_PREF, 0, 0); 185 1, views::GridLayout::USE_PREF, 0, 0);
184 186
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr), 388 CreateContactInfoSectionContent(), std::unique_ptr<views::View>(nullptr),
387 widest_name_column_view_width_); 389 widest_name_column_view_width_);
388 section->set_tag(static_cast<int>( 390 section->set_tag(static_cast<int>(
389 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON)); 391 PaymentSheetViewControllerTags::SHOW_CONTACT_INFO_BUTTON));
390 section->set_id( 392 section->set_id(
391 static_cast<int>(DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)); 393 static_cast<int>(DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION));
392 return section; 394 return section;
393 } 395 }
394 396
395 } // namespace payments 397 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698