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.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 }); | 1097 }); |
1098 } | 1098 } |
1099 | 1099 |
1100 @Override | 1100 @Override |
1101 public void onInstrumentDetailsLoadingWithoutUI() { | 1101 public void onInstrumentDetailsLoadingWithoutUI() { |
1102 if (mClient == null || mUI == null || mPaymentResponseHelper == null) re
turn; | 1102 if (mClient == null || mUI == null || mPaymentResponseHelper == null) re
turn; |
1103 | 1103 |
1104 assert mPaymentMethodsSection.getSelectedItem() instanceof AutofillPayme
ntInstrument; | 1104 assert mPaymentMethodsSection.getSelectedItem() instanceof AutofillPayme
ntInstrument; |
1105 | 1105 |
1106 mUI.showProcessingMessage(); | 1106 mUI.showProcessingMessage(); |
1107 mPaymentResponseHelper.onInstrumentsDetailsLoading(); | |
1108 } | 1107 } |
1109 | 1108 |
1110 @Override | 1109 @Override |
1111 public boolean onPayClicked(PaymentOption selectedShippingAddress, | 1110 public boolean onPayClicked(PaymentOption selectedShippingAddress, |
1112 PaymentOption selectedShippingOption, PaymentOption selectedPaymentM
ethod) { | 1111 PaymentOption selectedShippingOption, PaymentOption selectedPaymentM
ethod) { |
1113 assert selectedPaymentMethod instanceof PaymentInstrument; | 1112 assert selectedPaymentMethod instanceof PaymentInstrument; |
1114 PaymentInstrument instrument = (PaymentInstrument) selectedPaymentMethod
; | 1113 PaymentInstrument instrument = (PaymentInstrument) selectedPaymentMethod
; |
1115 mPaymentAppRunning = true; | 1114 mPaymentAppRunning = true; |
1116 | 1115 |
1117 PaymentOption selectedContact = mContactSection != null ? mContactSectio
n.getSelectedItem() | 1116 PaymentOption selectedContact = mContactSection != null ? mContactSectio
n.getSelectedItem() |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 | 1630 |
1632 /** | 1631 /** |
1633 * The frecency score is calculated according to use count and last use date
. The formula is | 1632 * The frecency score is calculated according to use count and last use date
. The formula is |
1634 * the same as the one used in GetFrecencyScore in autofill_data_model.cc. | 1633 * the same as the one used in GetFrecencyScore in autofill_data_model.cc. |
1635 */ | 1634 */ |
1636 private static final double getFrecencyScore(int count, long date) { | 1635 private static final double getFrecencyScore(int count, long date) { |
1637 long currentTime = System.currentTimeMillis(); | 1636 long currentTime = System.currentTimeMillis(); |
1638 return -Math.log((currentTime - date) / (24 * 60 * 60 * 1000) + 2) / Mat
h.log(count + 2); | 1637 return -Math.log((currentTime - date) / (24 * 60 * 60 * 1000) + 2) / Mat
h.log(count + 2); |
1639 } | 1638 } |
1640 } | 1639 } |
OLD | NEW |