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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillAddress.java

Issue 1937563002: PaymentRequest shipping address labels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 package org.chromium.chrome.browser.payments; 5 package org.chromium.chrome.browser.payments;
6 6
7 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; 7 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
8 import org.chromium.chrome.browser.payments.ui.PaymentOption; 8 import org.chromium.chrome.browser.payments.ui.PaymentOption;
9 import org.chromium.mojom.payments.ShippingAddress; 9 import org.chromium.mojom.payments.ShippingAddress;
10 10
(...skipping 15 matching lines...) Expand all
26 private static final int LANGUAGE_CODE_GROUP = 1; 26 private static final int LANGUAGE_CODE_GROUP = 1;
27 private static final int SCRIPT_CODE_GROUP = 3; 27 private static final int SCRIPT_CODE_GROUP = 3;
28 28
29 private final AutofillProfile mProfile; 29 private final AutofillProfile mProfile;
30 private Matcher mLanguageScriptCodeMatcher; 30 private Matcher mLanguageScriptCodeMatcher;
31 31
32 /** 32 /**
33 * Builds for the autofill address. 33 * Builds for the autofill address.
34 */ 34 */
35 public AutofillAddress(AutofillProfile profile) { 35 public AutofillAddress(AutofillProfile profile) {
36 super(profile.getGUID(), profile.getFullName(), profile.getStreetAddress (), 36 super(profile.getGUID(), profile.getLabel(), profile.getFullName(), Paym entOption.NO_ICON);
37 PaymentOption.NO_ICON);
38 37
39 assert profile.getCountryCode() != null : "Country code should not be nu ll"; 38 assert profile.getCountryCode() != null : "Country code should not be nu ll";
40 assert Pattern.compile(REGION_CODE_PATTERN).matcher(profile.getCountryCo de()).matches() 39 assert Pattern.compile(REGION_CODE_PATTERN).matcher(profile.getCountryCo de()).matches()
41 : "Country code should be in valid format"; 40 : "Country code should be in valid format";
42 41
43 assert profile.getStreetAddress() != null : "Street address should not b e null"; 42 assert profile.getStreetAddress() != null : "Street address should not b e null";
44 assert profile.getRegion() != null : "Region should not be null"; 43 assert profile.getRegion() != null : "Region should not be null";
45 assert profile.getLocality() != null : "Locality should not be null"; 44 assert profile.getLocality() != null : "Locality should not be null";
46 assert profile.getDependentLocality() != null : "Dependent locality shou ld not be null"; 45 assert profile.getDependentLocality() != null : "Dependent locality shou ld not be null";
47 assert profile.getPostalCode() != null : "Postal code should not be null "; 46 assert profile.getPostalCode() != null : "Postal code should not be null ";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 String languageCode = mLanguageScriptCodeMatcher.group(LANGUAGE_CODE _GROUP); 80 String languageCode = mLanguageScriptCodeMatcher.group(LANGUAGE_CODE _GROUP);
82 result.languageCode = languageCode != null ? languageCode : ""; 81 result.languageCode = languageCode != null ? languageCode : "";
83 82
84 String scriptCode = mLanguageScriptCodeMatcher.group(SCRIPT_CODE_GRO UP); 83 String scriptCode = mLanguageScriptCodeMatcher.group(SCRIPT_CODE_GRO UP);
85 result.scriptCode = scriptCode != null ? scriptCode : ""; 84 result.scriptCode = scriptCode != null ? scriptCode : "";
86 } 85 }
87 86
88 return result; 87 return result;
89 } 88 }
90 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698