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

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

Issue 2853163002: [Web Payments] Implement proper focusing in Payment Request (Closed)
Patch Set: Allow ViewControllers to specify their first focused view 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 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 <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 434
435 void PaymentSheetViewController::FillContentView(views::View* content_view) { 435 void PaymentSheetViewController::FillContentView(views::View* content_view) {
436 views::GridLayout* layout = new views::GridLayout(content_view); 436 views::GridLayout* layout = new views::GridLayout(content_view);
437 content_view->SetLayoutManager(layout); 437 content_view->SetLayoutManager(layout);
438 views::ColumnSet* columns = layout->AddColumnSet(0); 438 views::ColumnSet* columns = layout->AddColumnSet(0);
439 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 1, 439 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 1,
440 views::GridLayout::USE_PREF, 0, 0); 440 views::GridLayout::USE_PREF, 0, 0);
441 441
442 // The shipping address and contact info rows are optional. 442 // The shipping address and contact info rows are optional.
443 layout->StartRow(0, 0); 443 layout->StartRow(0, 0);
444 layout->AddView(CreatePaymentSheetSummaryRow().release()); 444 std::unique_ptr<views::View> summary_row = CreatePaymentSheetSummaryRow();
Mathieu 2017/05/02 13:16:10 need this change?
anthonyvd 2017/05/02 13:43:32 Oops, not anymore.
445 layout->AddView(summary_row.release());
445 446
446 if (spec()->request_shipping()) { 447 if (spec()->request_shipping()) {
447 layout->StartRow(0, 0); 448 layout->StartRow(0, 0);
448 layout->AddView(CreateShippingRow().release()); 449 layout->AddView(CreateShippingRow().release());
449 // It's possible for requestShipping to be true and for there to be no 450 // It's possible for requestShipping to be true and for there to be no
450 // shipping options yet (they will come in updateWith). 451 // shipping options yet (they will come in updateWith).
451 // TODO(crbug.com/707353): Put a better placeholder row, instead of no row. 452 // TODO(crbug.com/707353): Put a better placeholder row, instead of no row.
452 std::unique_ptr<views::Button> shipping_row = CreateShippingOptionRow(); 453 std::unique_ptr<views::Button> shipping_row = CreateShippingOptionRow();
453 if (shipping_row) { 454 if (shipping_row) {
454 layout->StartRow(0, 0); 455 layout->StartRow(0, 0);
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 } else { 857 } else {
857 return builder 858 return builder
858 .Id(DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON) 859 .Id(DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON)
859 .CreateWithButton( 860 .CreateWithButton(
860 l10n_util::GetStringUTF16(IDS_PAYMENT_REQUEST_CHOOSE_AN_ADDRESS), 861 l10n_util::GetStringUTF16(IDS_PAYMENT_REQUEST_CHOOSE_AN_ADDRESS),
861 l10n_util::GetStringUTF16(IDS_CHOOSE), /*button_enabled=*/false); 862 l10n_util::GetStringUTF16(IDS_CHOOSE), /*button_enabled=*/false);
862 } 863 }
863 } 864 }
864 865
865 } // namespace payments 866 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698