| 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 new views::Label(base::ASCIIToUTF16(items[i]->label))); | 432 new views::Label(base::ASCIIToUTF16(items[i]->label))); |
| 433 | 433 |
| 434 item_amounts_layout->StartRow(0, 0); | 434 item_amounts_layout->StartRow(0, 0); |
| 435 item_amounts_layout->AddView(new views::Label( | 435 item_amounts_layout->AddView(new views::Label( |
| 436 spec()->GetFormattedCurrencyAmount(items[i]->amount->value))); | 436 spec()->GetFormattedCurrencyAmount(items[i]->amount->value))); |
| 437 } | 437 } |
| 438 | 438 |
| 439 int hidden_item_count = items.size() - kMaxNumberOfItemsShown; | 439 int hidden_item_count = items.size() - kMaxNumberOfItemsShown; |
| 440 if (hidden_item_count > 0) { | 440 if (hidden_item_count > 0) { |
| 441 item_summaries_layout->StartRow(0, 0); | 441 item_summaries_layout->StartRow(0, 0); |
| 442 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>( | 442 std::unique_ptr<views::Label> label = |
| 443 l10n_util::GetStringFUTF16(IDS_PAYMENT_REQUEST_ORDER_SUMMARY_MORE_ITEMS, | 443 base::MakeUnique<views::Label>(l10n_util::GetPluralStringFUTF16( |
| 444 base::IntToString16(hidden_item_count))); | 444 IDS_PAYMENT_REQUEST_ORDER_SUMMARY_MORE_ITEMS, hidden_item_count)); |
| 445 label->SetDisabledColor(label->GetNativeTheme()->GetSystemColor( | 445 label->SetDisabledColor(label->GetNativeTheme()->GetSystemColor( |
| 446 ui::NativeTheme::kColorId_LabelDisabledColor)); | 446 ui::NativeTheme::kColorId_LabelDisabledColor)); |
| 447 label->SetEnabled(false); | 447 label->SetEnabled(false); |
| 448 item_summaries_layout->AddView(label.release()); | 448 item_summaries_layout->AddView(label.release()); |
| 449 | 449 |
| 450 item_amounts_layout->StartRow(0, 0); | 450 item_amounts_layout->StartRow(0, 0); |
| 451 item_amounts_layout->AddView(new views::Label(base::ASCIIToUTF16(""))); | 451 item_amounts_layout->AddView(new views::Label(base::ASCIIToUTF16(""))); |
| 452 } | 452 } |
| 453 | 453 |
| 454 item_summaries_layout->StartRow(0, 0); | 454 item_summaries_layout->StartRow(0, 0); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 PaymentSheetViewControllerTags::SHOW_SHIPPING_OPTION_BUTTON), | 680 PaymentSheetViewControllerTags::SHOW_SHIPPING_OPTION_BUTTON), |
| 681 static_cast<int>( | 681 static_cast<int>( |
| 682 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON), | 682 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON), |
| 683 widest_name_column_view_width_); | 683 widest_name_column_view_width_); |
| 684 } | 684 } |
| 685 | 685 |
| 686 return section; | 686 return section; |
| 687 } | 687 } |
| 688 | 688 |
| 689 } // namespace payments | 689 } // namespace payments |
| OLD | NEW |