OLD | NEW |
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 android.app.Activity; | 7 import android.app.Activity; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.os.Handler; | 9 import android.os.Handler; |
10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 List<AutofillAddress> addresses = new ArrayList<>(); | 206 List<AutofillAddress> addresses = new ArrayList<>(); |
207 List<AutofillProfile> profiles = PersonalDataManager.getInstance().getPr
ofilesToSuggest(); | 207 List<AutofillProfile> profiles = PersonalDataManager.getInstance().getPr
ofilesToSuggest(); |
208 for (int i = 0; i < profiles.size(); i++) { | 208 for (int i = 0; i < profiles.size(); i++) { |
209 AutofillProfile profile = profiles.get(i); | 209 AutofillProfile profile = profiles.get(i); |
210 if (profile.getCountryCode() != null | 210 if (profile.getCountryCode() != null |
211 && mRegionCodePattern.matcher(profile.getCountryCode()).matc
hes() | 211 && mRegionCodePattern.matcher(profile.getCountryCode()).matc
hes() |
212 && profile.getStreetAddress() != null && profile.getRegion()
!= null | 212 && profile.getStreetAddress() != null && profile.getRegion()
!= null |
213 && profile.getLocality() != null && profile.getDependentLoca
lity() != null | 213 && profile.getLocality() != null && profile.getDependentLoca
lity() != null |
214 && profile.getPostalCode() != null && profile.getSortingCode
() != null | 214 && profile.getPostalCode() != null && profile.getSortingCode
() != null |
215 && profile.getCompanyName() != null && profile.getFullName()
!= null) { | 215 && profile.getCompanyName() != null && profile.getFullName()
!= null |
| 216 && profile.getPhoneNumber() != null) { |
216 addresses.add(new AutofillAddress(profile)); | 217 addresses.add(new AutofillAddress(profile)); |
217 } | 218 } |
218 } | 219 } |
219 | 220 |
220 int selectedIndex = SectionInformation.NO_SELECTION; | 221 int selectedIndex = SectionInformation.NO_SELECTION; |
221 if (!addresses.isEmpty() && mUiShippingOptions.getSelectedItem() != null
) { | 222 if (!addresses.isEmpty() && mUiShippingOptions.getSelectedItem() != null
) { |
222 selectedIndex = 0; | 223 selectedIndex = 0; |
223 } | 224 } |
224 mShippingAddressesSection = new SectionInformation( | 225 mShippingAddressesSection = new SectionInformation( |
225 PaymentRequestUI.TYPE_SHIPPING_ADDRESSES, selectedIndex, address
es); | 226 PaymentRequestUI.TYPE_SHIPPING_ADDRESSES, selectedIndex, address
es); |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 } | 715 } |
715 mPaymentMethodsSection = null; | 716 mPaymentMethodsSection = null; |
716 } | 717 } |
717 } | 718 } |
718 | 719 |
719 private void closeClient() { | 720 private void closeClient() { |
720 if (mClient != null) mClient.close(); | 721 if (mClient != null) mClient.close(); |
721 mClient = null; | 722 mClient = null; |
722 } | 723 } |
723 } | 724 } |
OLD | NEW |