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

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

Issue 2437223002: Revert of Make PaymentOption store a Drawable instead of id (Closed)
Patch Set: Created 4 years, 2 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 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
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698