| 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/order_summary_view_controller.h" | 5 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // The first column has resize_percent = 1 so that it streches all the way | 62 // The first column has resize_percent = 1 so that it streches all the way |
| 63 // across the row up to the amount label. This way the first label elides as | 63 // across the row up to the amount label. This way the first label elides as |
| 64 // required. | 64 // required. |
| 65 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 1, | 65 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 1, |
| 66 views::GridLayout::USE_PREF, 0, 0); | 66 views::GridLayout::USE_PREF, 0, 0); |
| 67 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, | 67 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, |
| 68 views::GridLayout::FIXED, kAmountSectionWidth, | 68 views::GridLayout::FIXED, kAmountSectionWidth, |
| 69 kAmountSectionWidth); | 69 kAmountSectionWidth); |
| 70 | 70 |
| 71 layout->StartRow(0, 0); | 71 layout->StartRow(0, 0); |
| 72 std::unique_ptr<views::Label> label_text = | 72 std::unique_ptr<views::Label> label_text; |
| 73 base::MakeUnique<views::Label>(label); | 73 std::unique_ptr<views::Label> amount_text; |
| 74 std::unique_ptr<views::Label> amount_text = | 74 if (emphasize) { |
| 75 base::MakeUnique<views::Label>(amount); | 75 label_text = CreateMediumLabel(label); |
| 76 amount_text = CreateMediumLabel(amount); |
| 77 } else { |
| 78 label_text = base::MakeUnique<views::Label>(label); |
| 79 amount_text = base::MakeUnique<views::Label>(amount); |
| 80 } |
| 76 amount_text->set_id(static_cast<int>(amount_label_id)); | 81 amount_text->set_id(static_cast<int>(amount_label_id)); |
| 77 if (emphasize) { | |
| 78 label_text->SetFontList( | |
| 79 label_text->font_list().DeriveWithWeight(gfx::Font::Weight::MEDIUM)); | |
| 80 amount_text->SetFontList( | |
| 81 amount_text->font_list().DeriveWithWeight(gfx::Font::Weight::MEDIUM)); | |
| 82 } | |
| 83 layout->AddView(label_text.release()); | 82 layout->AddView(label_text.release()); |
| 84 layout->AddView(amount_text.release()); | 83 layout->AddView(amount_text.release()); |
| 85 | 84 |
| 86 return row; | 85 return row; |
| 87 } | 86 } |
| 88 | 87 |
| 89 } // namespace | 88 } // namespace |
| 90 | 89 |
| 91 OrderSummaryViewController::OrderSummaryViewController( | 90 OrderSummaryViewController::OrderSummaryViewController( |
| 92 PaymentRequestSpec* spec, | 91 PaymentRequestSpec* spec, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 total_label_value, true, | 172 total_label_value, true, |
| 174 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL) | 173 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL) |
| 175 .release()); | 174 .release()); |
| 176 } | 175 } |
| 177 | 176 |
| 178 void OrderSummaryViewController::UpdatePayButtonState(bool enabled) { | 177 void OrderSummaryViewController::UpdatePayButtonState(bool enabled) { |
| 179 pay_button_->SetEnabled(enabled); | 178 pay_button_->SetEnabled(enabled); |
| 180 } | 179 } |
| 181 | 180 |
| 182 } // namespace payments | 181 } // namespace payments |
| OLD | NEW |