| 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 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 | 1442 |
| 1443 recordSuccessFunnelHistograms("ReceivedInstrumentDetails"); | 1443 recordSuccessFunnelHistograms("ReceivedInstrumentDetails"); |
| 1444 | 1444 |
| 1445 mPaymentResponseHelper.onInstrumentDetailsReceived(methodName, stringifi
edDetails); | 1445 mPaymentResponseHelper.onInstrumentDetailsReceived(methodName, stringifi
edDetails); |
| 1446 } | 1446 } |
| 1447 | 1447 |
| 1448 @Override | 1448 @Override |
| 1449 public void onPaymentResponseReady(PaymentResponse response) { | 1449 public void onPaymentResponseReady(PaymentResponse response) { |
| 1450 mClient.onPaymentResponse(response); | 1450 mClient.onPaymentResponse(response); |
| 1451 mPaymentResponseHelper = null; | 1451 mPaymentResponseHelper = null; |
| 1452 PersonalDataManager.getInstance().cancelPendingAddressNormalizations(); | |
| 1453 } | 1452 } |
| 1454 | 1453 |
| 1455 /** | 1454 /** |
| 1456 * Called if unable to retrieve instrument details. | 1455 * Called if unable to retrieve instrument details. |
| 1457 */ | 1456 */ |
| 1458 @Override | 1457 @Override |
| 1459 public void onInstrumentDetailsError() { | 1458 public void onInstrumentDetailsError() { |
| 1460 if (mClient == null) return; | 1459 if (mClient == null) return; |
| 1461 mPaymentAppRunning = false; | 1460 mPaymentAppRunning = false; |
| 1462 // When skipping UI, any errors/cancel from fetching instrument details
should be | 1461 // When skipping UI, any errors/cancel from fetching instrument details
should be |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 | 1598 |
| 1600 /** | 1599 /** |
| 1601 * The frecency score is calculated according to use count and last use date
. The formula is | 1600 * The frecency score is calculated according to use count and last use date
. The formula is |
| 1602 * the same as the one used in GetFrecencyScore in autofill_data_model.cc. | 1601 * the same as the one used in GetFrecencyScore in autofill_data_model.cc. |
| 1603 */ | 1602 */ |
| 1604 private static final double getFrecencyScore(int count, long date) { | 1603 private static final double getFrecencyScore(int count, long date) { |
| 1605 long currentTime = System.currentTimeMillis(); | 1604 long currentTime = System.currentTimeMillis(); |
| 1606 return -Math.log((currentTime - date) / (24 * 60 * 60 * 1000) + 2) / Mat
h.log(count + 2); | 1605 return -Math.log((currentTime - date) / (24 * 60 * 60 * 1000) + 2) / Mat
h.log(count + 2); |
| 1607 } | 1606 } |
| 1608 } | 1607 } |
| OLD | NEW |