| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 layout->StartRow(0, 0); | 72 layout->StartRow(0, 0); |
| 73 std::unique_ptr<views::Label> label_text; | 73 std::unique_ptr<views::Label> label_text; |
| 74 std::unique_ptr<views::Label> currency_text; | 74 std::unique_ptr<views::Label> currency_text; |
| 75 std::unique_ptr<views::Label> amount_text; | 75 std::unique_ptr<views::Label> amount_text; |
| 76 if (emphasize) { | 76 if (emphasize) { |
| 77 label_text = CreateMediumLabel(label); | 77 label_text = CreateMediumLabel(label); |
| 78 currency_text = CreateMediumLabel(currency); | 78 currency_text = CreateMediumLabel(currency); |
| 79 amount_text = CreateMediumLabel(amount); | 79 amount_text = CreateMediumLabel(amount); |
| 80 } else { | 80 } else { |
| 81 label_text = base::MakeUnique<views::Label>(label); | 81 label_text = base::MakeUnique<views::Label>(label); |
| 82 currency_text = base::MakeUnique<views::Label>(currency); | 82 currency_text = CreateHintLabel(currency); |
| 83 currency_text->SetDisabledColor( | |
| 84 currency_text->GetNativeTheme()->GetSystemColor( | |
| 85 ui::NativeTheme::kColorId_LabelDisabledColor)); | |
| 86 currency_text->SetEnabled(false); | |
| 87 amount_text = base::MakeUnique<views::Label>(amount); | 83 amount_text = base::MakeUnique<views::Label>(amount); |
| 88 } | 84 } |
| 89 amount_text->set_id(static_cast<int>(amount_label_id)); | 85 amount_text->set_id(static_cast<int>(amount_label_id)); |
| 90 amount_text->SetMultiLine(true); | 86 amount_text->SetMultiLine(true); |
| 91 amount_text->SetAllowCharacterBreak(true); | 87 amount_text->SetAllowCharacterBreak(true); |
| 92 | 88 |
| 93 std::unique_ptr<views::View> amount_wrapper = base::MakeUnique<views::View>(); | 89 std::unique_ptr<views::View> amount_wrapper = base::MakeUnique<views::View>(); |
| 94 views::GridLayout* wrapper_layout = | 90 views::GridLayout* wrapper_layout = |
| 95 new views::GridLayout(amount_wrapper.get()); | 91 new views::GridLayout(amount_wrapper.get()); |
| 96 views::ColumnSet* wrapper_columns = wrapper_layout->AddColumnSet(0); | 92 views::ColumnSet* wrapper_columns = wrapper_layout->AddColumnSet(0); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 true, DialogViewID::ORDER_SUMMARY_TOTAL_CURRENCY_LABEL, | 195 true, DialogViewID::ORDER_SUMMARY_TOTAL_CURRENCY_LABEL, |
| 200 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL) | 196 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL) |
| 201 .release()); | 197 .release()); |
| 202 } | 198 } |
| 203 | 199 |
| 204 void OrderSummaryViewController::UpdatePayButtonState(bool enabled) { | 200 void OrderSummaryViewController::UpdatePayButtonState(bool enabled) { |
| 205 pay_button_->SetEnabled(enabled); | 201 pay_button_->SetEnabled(enabled); |
| 206 } | 202 } |
| 207 | 203 |
| 208 } // namespace payments | 204 } // namespace payments |
| OLD | NEW |