| 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_request_views_util.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 title_label->GetDefaultFontList().DeriveWithSizeDelta(2)); | 128 title_label->GetDefaultFontList().DeriveWithSizeDelta(2)); |
| 129 layout->AddView(title_label); | 129 layout->AddView(title_label); |
| 130 | 130 |
| 131 return container; | 131 return container; |
| 132 } | 132 } |
| 133 | 133 |
| 134 std::unique_ptr<views::ImageView> CreateCardIconView( | 134 std::unique_ptr<views::ImageView> CreateCardIconView( |
| 135 const std::string& card_type) { | 135 const std::string& card_type) { |
| 136 std::unique_ptr<views::ImageView> card_icon_view = | 136 std::unique_ptr<views::ImageView> card_icon_view = |
| 137 base::MakeUnique<views::ImageView>(); | 137 base::MakeUnique<views::ImageView>(); |
| 138 card_icon_view->set_interactive(false); | 138 card_icon_view->set_can_process_events_within_subtree(false); |
| 139 card_icon_view->SetImage( | 139 card_icon_view->SetImage( |
| 140 ResourceBundle::GetSharedInstance() | 140 ResourceBundle::GetSharedInstance() |
| 141 .GetImageNamed(autofill::data_util::GetPaymentRequestData(card_type) | 141 .GetImageNamed(autofill::data_util::GetPaymentRequestData(card_type) |
| 142 .icon_resource_id) | 142 .icon_resource_id) |
| 143 .AsImageSkia()); | 143 .AsImageSkia()); |
| 144 card_icon_view->SetTooltipText( | 144 card_icon_view->SetTooltipText( |
| 145 autofill::CreditCard::TypeForDisplay(card_type)); | 145 autofill::CreditCard::TypeForDisplay(card_type)); |
| 146 card_icon_view->SetBorder(views::CreateRoundedRectBorder( | 146 card_icon_view->SetBorder(views::CreateRoundedRectBorder( |
| 147 1, 3, card_icon_view->GetNativeTheme()->GetSystemColor( | 147 1, 3, card_icon_view->GetNativeTheme()->GetSystemColor( |
| 148 ui::NativeTheme::kColorId_UnfocusedBorderColor))); | 148 ui::NativeTheme::kColorId_UnfocusedBorderColor))); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 // Creates a views::Border object that can paint the gray horizontal ruler used | 218 // Creates a views::Border object that can paint the gray horizontal ruler used |
| 219 // as a separator between items in the Payment Request dialog. | 219 // as a separator between items in the Payment Request dialog. |
| 220 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder() { | 220 std::unique_ptr<views::Border> CreatePaymentRequestRowBorder() { |
| 221 return views::CreateBorderPainter( | 221 return views::CreateBorderPainter( |
| 222 base::MakeUnique<PaymentRequestRowBorderPainter>(), | 222 base::MakeUnique<PaymentRequestRowBorderPainter>(), |
| 223 gfx::Insets()); | 223 gfx::Insets()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace payments | 226 } // namespace payments |
| OLD | NEW |