| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 views::Label* title_label = | 215 views::Label* title_label = |
| 216 new views::Label(title, views::style::CONTEXT_DIALOG_TITLE); | 216 new views::Label(title, views::style::CONTEXT_DIALOG_TITLE); |
| 217 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 217 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 218 layout->AddView(title_label); | 218 layout->AddView(title_label); |
| 219 | 219 |
| 220 return container; | 220 return container; |
| 221 } | 221 } |
| 222 | 222 |
| 223 std::unique_ptr<views::ImageView> CreateInstrumentIconView( | 223 std::unique_ptr<views::ImageView> CreateInstrumentIconView( |
| 224 int icon_resource_id, | 224 int icon_resource_id, |
| 225 const base::string16& tooltip_text) { | 225 const base::string16& tooltip_text, |
| 226 float opacity) { |
| 226 std::unique_ptr<views::ImageView> card_icon_view = | 227 std::unique_ptr<views::ImageView> card_icon_view = |
| 227 base::MakeUnique<views::ImageView>(); | 228 base::MakeUnique<views::ImageView>(); |
| 228 card_icon_view->set_can_process_events_within_subtree(false); | 229 card_icon_view->set_can_process_events_within_subtree(false); |
| 229 card_icon_view->SetImage(ResourceBundle::GetSharedInstance() | 230 card_icon_view->SetImage(ResourceBundle::GetSharedInstance() |
| 230 .GetImageNamed(icon_resource_id) | 231 .GetImageNamed(icon_resource_id) |
| 231 .AsImageSkia()); | 232 .AsImageSkia()); |
| 232 card_icon_view->SetTooltipText(tooltip_text); | 233 card_icon_view->SetTooltipText(tooltip_text); |
| 234 card_icon_view->SetPaintToLayer(); |
| 235 card_icon_view->layer()->SetOpacity(opacity); |
| 233 return card_icon_view; | 236 return card_icon_view; |
| 234 } | 237 } |
| 235 | 238 |
| 236 std::unique_ptr<views::View> CreateProductLogoFooterView() { | 239 std::unique_ptr<views::View> CreateProductLogoFooterView() { |
| 237 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>(); | 240 std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>(); |
| 238 | 241 |
| 239 views::BoxLayout* layout = | 242 views::BoxLayout* layout = |
| 240 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); | 243 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); |
| 241 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); | 244 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); |
| 242 layout->set_cross_axis_alignment( | 245 layout->set_cross_axis_alignment( |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 amount_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 377 amount_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 375 amount_label->set_id( | 378 amount_label->set_id( |
| 376 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); | 379 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); |
| 377 container->AddChildView(amount_label.release()); | 380 container->AddChildView(amount_label.release()); |
| 378 } | 381 } |
| 379 | 382 |
| 380 return container; | 383 return container; |
| 381 } | 384 } |
| 382 | 385 |
| 383 } // namespace payments | 386 } // namespace payments |
| OLD | NEW |