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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 faviconHelper.destroy(); | 227 faviconHelper.destroy(); |
228 if (bitmap == null) return; | 228 if (bitmap == null) return; |
229 if (mUI == null) { | 229 if (mUI == null) { |
230 mFavicon = bitmap; | 230 mFavicon = bitmap; |
231 return; | 231 return; |
232 } | 232 } |
233 mUI.setTitleBitmap(bitmap); | 233 mUI.setTitleBitmap(bitmap); |
234 } | 234 } |
235 }); | 235 }); |
236 | 236 |
237 mApps = PaymentAppFactory.create(mContext, webContents); | 237 mApps = PaymentAppFactory.create(webContents); |
238 | 238 |
239 mAddressEditor = new AddressEditor(); | 239 mAddressEditor = new AddressEditor(); |
240 mCardEditor = new CardEditor(webContents, mAddressEditor, sObserverForTe
st); | 240 mCardEditor = new CardEditor(webContents, mAddressEditor, sObserverForTe
st); |
241 | 241 |
242 recordSuccessFunnelHistograms("Initiated"); | 242 recordSuccessFunnelHistograms("Initiated"); |
243 } | 243 } |
244 | 244 |
245 /** | 245 /** |
246 * Called by the merchant website to initialize the payment request data. | 246 * Called by the merchant website to initialize the payment request data. |
247 */ | 247 */ |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 || !formatter.isValidAmountValue(option.amount.value)) { | 647 || !formatter.isValidAmountValue(option.amount.value)) { |
648 return null; | 648 return null; |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 List<PaymentOption> result = new ArrayList<>(); | 652 List<PaymentOption> result = new ArrayList<>(); |
653 int selectedItemIndex = SectionInformation.NO_SELECTION; | 653 int selectedItemIndex = SectionInformation.NO_SELECTION; |
654 for (int i = 0; i < options.length; i++) { | 654 for (int i = 0; i < options.length; i++) { |
655 PaymentShippingOption option = options[i]; | 655 PaymentShippingOption option = options[i]; |
656 result.add(new PaymentOption(option.id, option.label, | 656 result.add(new PaymentOption(option.id, option.label, |
657 formatter.format(option.amount.value), null)); | 657 formatter.format(option.amount.value), PaymentOption.NO_ICON
)); |
658 if (option.selected) selectedItemIndex = i; | 658 if (option.selected) selectedItemIndex = i; |
659 } | 659 } |
660 | 660 |
661 return new SectionInformation(PaymentRequestUI.TYPE_SHIPPING_OPTIONS, se
lectedItemIndex, | 661 return new SectionInformation(PaymentRequestUI.TYPE_SHIPPING_OPTIONS, se
lectedItemIndex, |
662 result); | 662 result); |
663 } | 663 } |
664 | 664 |
665 /** | 665 /** |
666 * Called to retrieve the data to show in the initial PaymentRequest UI. | 666 * Called to retrieve the data to show in the initial PaymentRequest UI. |
667 */ | 667 */ |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 "PaymentRequest.CheckoutFunnel.Aborted", abortReason, | 1262 "PaymentRequest.CheckoutFunnel.Aborted", abortReason, |
1263 PaymentRequestMetrics.ABORT_REASON_MAX); | 1263 PaymentRequestMetrics.ABORT_REASON_MAX); |
1264 | 1264 |
1265 if (abortReason == PaymentRequestMetrics.ABORT_REASON_ABORTED_BY_USER) { | 1265 if (abortReason == PaymentRequestMetrics.ABORT_REASON_ABORTED_BY_USER) { |
1266 mJourneyLogger.recordJourneyStatsHistograms("UserAborted"); | 1266 mJourneyLogger.recordJourneyStatsHistograms("UserAborted"); |
1267 } else { | 1267 } else { |
1268 mJourneyLogger.recordJourneyStatsHistograms("OtherAborted"); | 1268 mJourneyLogger.recordJourneyStatsHistograms("OtherAborted"); |
1269 } | 1269 } |
1270 } | 1270 } |
1271 } | 1271 } |
OLD | NEW |