| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 std::unique_ptr<views::BoxLayout> layout = | 282 std::unique_ptr<views::BoxLayout> layout = |
| 283 base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 0, 0, 0); | 283 base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 0, 0, 0); |
| 284 layout->set_cross_axis_alignment( | 284 layout->set_cross_axis_alignment( |
| 285 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); | 285 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); |
| 286 container->SetLayoutManager(layout.release()); | 286 container->SetLayoutManager(layout.release()); |
| 287 | 287 |
| 288 if (shipping_option) { | 288 if (shipping_option) { |
| 289 std::unique_ptr<views::Label> shipping_label = | 289 std::unique_ptr<views::Label> shipping_label = |
| 290 base::MakeUnique<views::Label>( | 290 base::MakeUnique<views::Label>( |
| 291 base::ASCIIToUTF16(shipping_option->label)); | 291 base::UTF8ToUTF16(shipping_option->label)); |
| 292 shipping_label->set_id( | 292 shipping_label->set_id( |
| 293 static_cast<int>(DialogViewID::SHIPPING_OPTION_DESCRIPTION)); | 293 static_cast<int>(DialogViewID::SHIPPING_OPTION_DESCRIPTION)); |
| 294 container->AddChildView(shipping_label.release()); | 294 container->AddChildView(shipping_label.release()); |
| 295 | 295 |
| 296 std::unique_ptr<views::Label> amount_label = | 296 std::unique_ptr<views::Label> amount_label = |
| 297 base::MakeUnique<views::Label>(formatted_amount); | 297 base::MakeUnique<views::Label>(formatted_amount); |
| 298 amount_label->set_id( | 298 amount_label->set_id( |
| 299 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); | 299 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); |
| 300 container->AddChildView(amount_label.release()); | 300 container->AddChildView(amount_label.release()); |
| 301 } | 301 } |
| 302 | 302 |
| 303 return container; | 303 return container; |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace payments | 306 } // namespace payments |
| OLD | NEW |