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

Unified Diff: chrome/browser/ui/views/payments/payment_request_views_util.cc

Issue 2871173005: [Payments] Remove extra line in shipping 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/payment_request_views_util.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.cc b/chrome/browser/ui/views/payments/payment_request_views_util.cc
index 405c62b5d4df07b05b64293b55473ebafbd11d42..2d3b335dd23a1621448f004292277f34aee5fcc3 100644
--- a/chrome/browser/ui/views/payments/payment_request_views_util.cc
+++ b/chrome/browser/ui/views/payments/payment_request_views_util.cc
@@ -305,9 +305,10 @@ std::unique_ptr<views::View> GetShippingAddressLabelWithMissingInfo(
std::unique_ptr<views::View> base_label =
GetShippingAddressLabel(type, locale, profile, /*disabled_state=*/false);
- base_label->AddChildView(GetLabelForMissingInformation(
- comp.GetStringForMissingShippingFields(profile))
- .release());
+ base::string16 missing = comp.GetStringForMissingShippingFields(profile);
+ if (!missing.empty()) {
+ base_label->AddChildView(GetLabelForMissingInformation(missing).release());
+ }
return base_label;
}
@@ -339,9 +340,10 @@ std::unique_ptr<views::View> GetContactInfoLabel(
std::unique_ptr<views::View> base_label =
GetBaseProfileLabel(type, name, phone, email);
- base_label->AddChildView(GetLabelForMissingInformation(
- comp.GetStringForMissingContactFields(profile))
- .release());
+ base::string16 missing = comp.GetStringForMissingContactFields(profile);
+ if (!missing.empty()) {
+ base_label->AddChildView(GetLabelForMissingInformation(missing).release());
+ }
return base_label;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698