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.os.AsyncTask; | 7 import android.os.AsyncTask; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
10 import android.util.Pair; | 10 import android.util.Pair; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 public CardEditor(WebContents webContents, AddressEditor addressEditor, | 134 public CardEditor(WebContents webContents, AddressEditor addressEditor, |
135 @Nullable PaymentRequestServiceObserverForTest observerForTest) { | 135 @Nullable PaymentRequestServiceObserverForTest observerForTest) { |
136 assert webContents != null; | 136 assert webContents != null; |
137 assert addressEditor != null; | 137 assert addressEditor != null; |
138 | 138 |
139 mWebContents = webContents; | 139 mWebContents = webContents; |
140 mAddressEditor = addressEditor; | 140 mAddressEditor = addressEditor; |
141 mObserverForTest = observerForTest; | 141 mObserverForTest = observerForTest; |
142 | 142 |
143 List<AutofillProfile> profiles = PersonalDataManager.getInstance().getPr
ofilesToSuggest( | 143 List<AutofillProfile> profiles = PersonalDataManager.getInstance().getPr
ofilesToSuggest( |
144 true /* includeName */); | 144 true /* includeNameInLabel */); |
145 mProfilesForBillingAddress = new HashMap<>(); | 145 mProfilesForBillingAddress = new HashMap<>(); |
146 for (int i = 0; i < profiles.size(); i++) { | 146 for (int i = 0; i < profiles.size(); i++) { |
147 AutofillProfile profile = profiles.get(i); | 147 AutofillProfile profile = profiles.get(i); |
148 // 1) Include only local profiles, because GUIDs of server profiles
change on every | 148 // 1) Include only local profiles, because GUIDs of server profiles
change on every |
149 // browser restart. Server profiles are not supported as billing
addresses. | 149 // browser restart. Server profiles are not supported as billing
addresses. |
150 // 2) Include only complete profiles, so that user launches the edit
or only when | 150 // 2) Include only complete profiles, so that user launches the edit
or only when |
151 // explicitly selecting [+ ADD ADDRESS] in the dropdown. | 151 // explicitly selecting [+ ADD ADDRESS] in the dropdown. |
152 if (profile.getIsLocal() && mAddressEditor.isProfileComplete(profile
)) { | 152 if (profile.getIsLocal() && mAddressEditor.isProfileComplete(profile
)) { |
153 mProfilesForBillingAddress.put(profile.getGUID(), profile); | 153 mProfilesForBillingAddress.put(profile.getGUID(), profile); |
154 } | 154 } |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 | 605 |
606 mEditorView.update(); | 606 mEditorView.update(); |
607 mIsScanning = false; | 607 mIsScanning = false; |
608 } | 608 } |
609 | 609 |
610 @Override | 610 @Override |
611 public void onScanCancelled() { | 611 public void onScanCancelled() { |
612 mIsScanning = false; | 612 mIsScanning = false; |
613 } | 613 } |
614 } | 614 } |
OLD | NEW |