OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_method_view_controller.h" | 5 #include "chrome/browser/ui/views/payments/payment_method_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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/ui/views/harmony/chrome_typography.h" | |
17 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" | 16 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
18 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" | 17 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" |
19 #include "chrome/browser/ui/views/payments/payment_request_row_view.h" | 18 #include "chrome/browser/ui/views/payments/payment_request_row_view.h" |
20 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 19 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
21 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
22 #include "components/payments/content/payment_request_state.h" | 21 #include "components/payments/content/payment_request_state.h" |
23 #include "components/payments/core/autofill_payment_instrument.h" | 22 #include "components/payments/core/autofill_payment_instrument.h" |
24 #include "components/payments/core/payment_instrument.h" | 23 #include "components/payments/core/payment_instrument.h" |
25 #include "components/strings/grit/components_strings.h" | 24 #include "components/strings/grit/components_strings.h" |
26 #include "third_party/skia/include/core/SkColor.h" | 25 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 card_info_container->SetLayoutManager(box_layout.release()); | 109 card_info_container->SetLayoutManager(box_layout.release()); |
111 | 110 |
112 if (!instrument_->label().empty()) | 111 if (!instrument_->label().empty()) |
113 card_info_container->AddChildView(new views::Label(instrument_->label())); | 112 card_info_container->AddChildView(new views::Label(instrument_->label())); |
114 if (!instrument_->sublabel().empty()) { | 113 if (!instrument_->sublabel().empty()) { |
115 card_info_container->AddChildView( | 114 card_info_container->AddChildView( |
116 new views::Label(instrument_->sublabel())); | 115 new views::Label(instrument_->sublabel())); |
117 } | 116 } |
118 if (!instrument_->IsCompleteForPayment()) { | 117 if (!instrument_->IsCompleteForPayment()) { |
119 std::unique_ptr<views::Label> missing_info_label = | 118 std::unique_ptr<views::Label> missing_info_label = |
120 base::MakeUnique<views::Label>(instrument_->GetMissingInfoLabel(), | 119 base::MakeUnique<views::Label>(instrument_->GetMissingInfoLabel()); |
121 CONTEXT_DEPRECATED_SMALL); | 120 missing_info_label->SetFontList( |
| 121 missing_info_label->GetDefaultFontList().DeriveWithSizeDelta(-1)); |
122 missing_info_label->SetEnabledColor( | 122 missing_info_label->SetEnabledColor( |
123 missing_info_label->GetNativeTheme()->GetSystemColor( | 123 missing_info_label->GetNativeTheme()->GetSystemColor( |
124 ui::NativeTheme::kColorId_LinkEnabled)); | 124 ui::NativeTheme::kColorId_LinkEnabled)); |
125 card_info_container->AddChildView(missing_info_label.release()); | 125 card_info_container->AddChildView(missing_info_label.release()); |
126 } | 126 } |
127 | 127 |
128 return card_info_container; | 128 return card_info_container; |
129 } | 129 } |
130 | 130 |
131 void SelectedStateChanged() override { | 131 void SelectedStateChanged() override { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 base::Unretained(state()), /*selected=*/true), | 224 base::Unretained(state()), /*selected=*/true), |
225 /*credit_card=*/nullptr); | 225 /*credit_card=*/nullptr); |
226 break; | 226 break; |
227 default: | 227 default: |
228 PaymentRequestSheetController::ButtonPressed(sender, event); | 228 PaymentRequestSheetController::ButtonPressed(sender, event); |
229 break; | 229 break; |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 } // namespace payments | 233 } // namespace payments |
OLD | NEW |