OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |