Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_views_util.cc

Issue 2830053002: [Web Payments] Correctly use UTF8ToUTF16 on strings from website. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_sheet_view_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_sheet_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698