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

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

Issue 2847813003: [Web Payments] Fix alignment of certain Payment Sheet labels. (Closed)
Patch Set: Created 3 years, 7 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); 73 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
74 container->SetLayoutManager(layout.release()); 74 container->SetLayoutManager(layout.release());
75 75
76 if (!s1.empty()) { 76 if (!s1.empty()) {
77 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s1); 77 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s1);
78 if (type == AddressStyleType::DETAILED) { 78 if (type == AddressStyleType::DETAILED) {
79 const gfx::FontList& font_list = label->font_list(); 79 const gfx::FontList& font_list = label->font_list();
80 label->SetFontList(font_list.DeriveWithWeight(gfx::Font::Weight::BOLD)); 80 label->SetFontList(font_list.DeriveWithWeight(gfx::Font::Weight::BOLD));
81 } 81 }
82 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_1)); 82 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_1));
83 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
Mathieu 2017/04/27 18:17:00 bleh, how is this not the default :\
83 container->AddChildView(label.release()); 84 container->AddChildView(label.release());
84 } 85 }
85 86
86 if (!s2.empty()) { 87 if (!s2.empty()) {
87 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s2); 88 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s2);
88 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_2)); 89 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_2));
90 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
89 container->AddChildView(label.release()); 91 container->AddChildView(label.release());
90 } 92 }
91 93
92 if (!s3.empty()) { 94 if (!s3.empty()) {
93 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s3); 95 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>(s3);
94 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_3)); 96 label->set_id(static_cast<int>(DialogViewID::THREE_LINE_LABEL_LINE_3));
97 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
95 container->AddChildView(label.release()); 98 container->AddChildView(label.release());
96 } 99 }
97 100
98 // TODO(anthonyvd): add the error label 101 // TODO(anthonyvd): add the error label
99 102
100 return container; 103 return container;
101 } 104 }
102 105
103 // Paints the gray horizontal line that doesn't span the entire width of the 106 // Paints the gray horizontal line that doesn't span the entire width of the
104 // dialog at the bottom of the view it borders. 107 // dialog at the bottom of the view it borders.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 base::MakeUnique<views::Label>(formatted_amount); 300 base::MakeUnique<views::Label>(formatted_amount);
298 amount_label->set_id( 301 amount_label->set_id(
299 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); 302 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT));
300 container->AddChildView(amount_label.release()); 303 container->AddChildView(amount_label.release());
301 } 304 }
302 305
303 return container; 306 return container;
304 } 307 }
305 308
306 } // namespace payments 309 } // 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