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