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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 boolean requestShipping = options != null && options.requestShipping; | 164 boolean requestShipping = options != null && options.requestShipping; |
165 mMerchantNeedsShippingAddress = requestShipping && mShippingOptionsSecti
on.isEmpty(); | 165 mMerchantNeedsShippingAddress = requestShipping && mShippingOptionsSecti
on.isEmpty(); |
166 | 166 |
167 mData = getValidatedData(mSupportedMethods, stringifiedData); | 167 mData = getValidatedData(mSupportedMethods, stringifiedData); |
168 if (mData == null) { | 168 if (mData == null) { |
169 disconnectFromClientWithDebugMessage("Invalid payment method specifi
c data"); | 169 disconnectFromClientWithDebugMessage("Invalid payment method specifi
c data"); |
170 return; | 170 return; |
171 } | 171 } |
172 | 172 |
173 List<AutofillAddress> addresses = new ArrayList<>(); | 173 List<AutofillAddress> addresses = new ArrayList<>(); |
174 List<AutofillProfile> profiles = PersonalDataManager.getInstance().getAd
dressOnlyProfiles(); | 174 List<AutofillProfile> profiles = PersonalDataManager.getInstance().getPr
ofilesToSuggest(); |
175 for (int i = 0; i < profiles.size(); i++) { | 175 for (int i = 0; i < profiles.size(); i++) { |
176 AutofillProfile profile = profiles.get(i); | 176 AutofillProfile profile = profiles.get(i); |
177 if (profile.getCountryCode() != null | 177 if (profile.getCountryCode() != null |
178 && mRegionCodePattern.matcher(profile.getCountryCode()).matc
hes() | 178 && mRegionCodePattern.matcher(profile.getCountryCode()).matc
hes() |
179 && profile.getStreetAddress() != null && profile.getRegion()
!= null | 179 && profile.getStreetAddress() != null && profile.getRegion()
!= null |
180 && profile.getLocality() != null && profile.getDependentLoca
lity() != null | 180 && profile.getLocality() != null && profile.getDependentLoca
lity() != null |
181 && profile.getPostalCode() != null && profile.getSortingCode
() != null | 181 && profile.getPostalCode() != null && profile.getSortingCode
() != null |
182 && profile.getCompanyName() != null && profile.getFullName()
!= null) { | 182 && profile.getCompanyName() != null && profile.getFullName()
!= null) { |
183 addresses.add(new AutofillAddress(profile)); | 183 addresses.add(new AutofillAddress(profile)); |
184 } | 184 } |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } | 608 } |
609 mPaymentMethodsSection = null; | 609 mPaymentMethodsSection = null; |
610 } | 610 } |
611 } | 611 } |
612 | 612 |
613 private void closeClient() { | 613 private void closeClient() { |
614 if (mClient != null) mClient.close(); | 614 if (mClient != null) mClient.close(); |
615 mClient = null; | 615 mClient = null; |
616 } | 616 } |
617 } | 617 } |
OLD | NEW |