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

Side by Side Diff: ios/chrome/browser/payments/payment_request_utils.mm

Issue 2585233003: Upstream Chrome on iOS source code [2/11]. (Closed)
Patch Set: Created 4 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/chrome/browser/payments/payment_request_utils.h"
6
7 #include "base/strings/sys_string_conversions.h"
8 #include "components/autofill/core/browser/autofill_profile.h"
9 #include "ios/chrome/browser/application_context.h"
10
11 namespace payment_request_utils {
12
13 NSString* AddressLabelFromAutofillProfile(autofill::AutofillProfile* profile) {
14 // Name, company, and country are not included in the shipping address label.
15 std::vector<autofill::ServerFieldType> label_fields;
16 label_fields.push_back(autofill::ADDRESS_HOME_LINE1);
17 label_fields.push_back(autofill::ADDRESS_HOME_LINE2);
18 label_fields.push_back(autofill::ADDRESS_HOME_DEPENDENT_LOCALITY);
19 label_fields.push_back(autofill::ADDRESS_HOME_CITY);
20 label_fields.push_back(autofill::ADDRESS_HOME_STATE);
21 label_fields.push_back(autofill::ADDRESS_HOME_ZIP);
22 label_fields.push_back(autofill::ADDRESS_HOME_SORTING_CODE);
23
24 return base::SysUTF16ToNSString(profile->ConstructInferredLabel(
25 label_fields, label_fields.size(),
26 GetApplicationContext()->GetApplicationLocale()));
27 }
28
29 } // namespace payment_request_utils
OLDNEW
« no previous file with comments | « ios/chrome/browser/payments/payment_request_utils.h ('k') | ios/chrome/browser/payments/payment_request_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698