| 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; |
| 11 import android.os.Handler; | 11 import android.os.Handler; |
| 12 import android.support.v4.util.ArrayMap; | 12 import android.support.v4.util.ArrayMap; |
| 13 import android.text.TextUtils; | 13 import android.text.TextUtils; |
| 14 | 14 |
| 15 import org.chromium.base.Callback; | 15 import org.chromium.base.Callback; |
| 16 import org.chromium.base.Log; | 16 import org.chromium.base.Log; |
| 17 import org.chromium.base.VisibleForTesting; | 17 import org.chromium.base.VisibleForTesting; |
| 18 import org.chromium.base.metrics.RecordHistogram; | 18 import org.chromium.base.metrics.RecordHistogram; |
| 19 import org.chromium.chrome.R; | 19 import org.chromium.chrome.R; |
| 20 import org.chromium.chrome.browser.ChromeActivity; | 20 import org.chromium.chrome.browser.ChromeActivity; |
| 21 import org.chromium.chrome.browser.ChromeFeatureList; | 21 import org.chromium.chrome.browser.ChromeFeatureList; |
| 22 import org.chromium.chrome.browser.UrlConstants; | 22 import org.chromium.chrome.browser.UrlConstants; |
| 23 import org.chromium.chrome.browser.autofill.PersonalDataManager; | 23 import org.chromium.chrome.browser.autofill.PersonalDataManager; |
| 24 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; | 24 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| 25 import org.chromium.chrome.browser.favicon.FaviconHelper; | 25 import org.chromium.chrome.browser.favicon.FaviconHelper; |
| 26 import org.chromium.chrome.browser.pageinfo.CertificateChainHelper; | 26 import org.chromium.chrome.browser.page_info.CertificateChainHelper; |
| 27 import org.chromium.chrome.browser.payments.ui.Completable; | 27 import org.chromium.chrome.browser.payments.ui.Completable; |
| 28 import org.chromium.chrome.browser.payments.ui.ContactDetailsSection; | 28 import org.chromium.chrome.browser.payments.ui.ContactDetailsSection; |
| 29 import org.chromium.chrome.browser.payments.ui.LineItem; | 29 import org.chromium.chrome.browser.payments.ui.LineItem; |
| 30 import org.chromium.chrome.browser.payments.ui.PaymentInformation; | 30 import org.chromium.chrome.browser.payments.ui.PaymentInformation; |
| 31 import org.chromium.chrome.browser.payments.ui.PaymentOption; | 31 import org.chromium.chrome.browser.payments.ui.PaymentOption; |
| 32 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.OptionSecti
on.FocusChangedObserver; | 32 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.OptionSecti
on.FocusChangedObserver; |
| 33 import org.chromium.chrome.browser.payments.ui.PaymentRequestUI; | 33 import org.chromium.chrome.browser.payments.ui.PaymentRequestUI; |
| 34 import org.chromium.chrome.browser.payments.ui.SectionInformation; | 34 import org.chromium.chrome.browser.payments.ui.SectionInformation; |
| 35 import org.chromium.chrome.browser.payments.ui.ShoppingCart; | 35 import org.chromium.chrome.browser.payments.ui.ShoppingCart; |
| 36 import org.chromium.chrome.browser.preferences.PreferencesLauncher; | 36 import org.chromium.chrome.browser.preferences.PreferencesLauncher; |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1677 | 1677 |
| 1678 /** | 1678 /** |
| 1679 * The frecency score is calculated according to use count and last use date
. The formula is | 1679 * The frecency score is calculated according to use count and last use date
. The formula is |
| 1680 * the same as the one used in GetFrecencyScore in autofill_data_model.cc. | 1680 * the same as the one used in GetFrecencyScore in autofill_data_model.cc. |
| 1681 */ | 1681 */ |
| 1682 private static final double getFrecencyScore(int count, long date) { | 1682 private static final double getFrecencyScore(int count, long date) { |
| 1683 long currentTime = System.currentTimeMillis(); | 1683 long currentTime = System.currentTimeMillis(); |
| 1684 return -Math.log((currentTime - date) / (24 * 60 * 60 * 1000) + 2) / Mat
h.log(count + 2); | 1684 return -Math.log((currentTime - date) / (24 * 60 * 60 * 1000) + 2) / Mat
h.log(count + 2); |
| 1685 } | 1685 } |
| 1686 } | 1686 } |
| OLD | NEW |