Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java |
index 85dec0b2e464130597040576d761f3520b07866e..b18f584715509e5ac87eb45fe81b18a59ae16452 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java |
@@ -636,6 +636,17 @@ public class PersonalDataManager { |
mPersonalDataManagerAndroid, webContents, guid, delegate); |
} |
+ /** |
+ * Records the use of the profile associated with the specified |guid|. Effectively increments |
+ * the use count of the profile and set its use date to the current time. Also logs usage |
please use gerrit instead
2016/07/12 15:41:57
s/set/sets/
sebsg
2016/07/13 18:49:19
Done.
|
+ * metrics. |
+ * @param guid The GUID of the profile. |
please use gerrit instead
2016/07/12 15:41:57
newline before @param
sebsg
2016/07/13 18:49:19
Done.
|
+ */ |
+ public void recordAndLogProfileUse(String guid) { |
+ ThreadUtils.assertOnUiThread(); |
+ nativeRecordAndLogProfileUse(mPersonalDataManagerAndroid, guid); |
+ } |
+ |
@VisibleForTesting |
protected void setProfileUseStatsForTesting(String guid, int count, long date) { |
ThreadUtils.assertOnUiThread(); |
@@ -643,11 +654,52 @@ public class PersonalDataManager { |
} |
@VisibleForTesting |
+ protected int getProfileUseCountForTesting(String guid) { |
please use gerrit instead
2016/07/12 15:41:57
Remove "protected". This will make the access of t
sebsg
2016/07/13 18:49:19
Done.
|
+ ThreadUtils.assertOnUiThread(); |
+ return nativeGetProfileUseCountForTesting(mPersonalDataManagerAndroid, guid); |
+ } |
+ |
+ @VisibleForTesting |
+ protected long getProfileUseDateForTesting(String guid) { |
please use gerrit instead
2016/07/12 15:41:57
Ditto
sebsg
2016/07/13 18:49:19
Done.
|
+ ThreadUtils.assertOnUiThread(); |
+ return nativeGetProfileUseDateForTesting(mPersonalDataManagerAndroid, guid); |
+ } |
+ |
+ /** |
+ * Records the use of the credit card associated with the specified |guid|. Effectively |
+ * increments the use count of the credit card and set its use date to the current time. Also |
+ * logs usage metrics. |
+ * @param guid The GUID of the credit card. |
please use gerrit instead
2016/07/12 15:41:57
newline before @param
sebsg
2016/07/13 18:49:19
Done.
|
+ */ |
+ public void recordAndLogCreditCardUse(String guid) { |
+ ThreadUtils.assertOnUiThread(); |
+ nativeRecordAndLogCreditCardUse(mPersonalDataManagerAndroid, guid); |
+ } |
+ |
+ @VisibleForTesting |
protected void setCreditCardUseStatsForTesting(String guid, int count, long date) { |
ThreadUtils.assertOnUiThread(); |
nativeSetCreditCardUseStatsForTesting(mPersonalDataManagerAndroid, guid, count, date); |
} |
+ @VisibleForTesting |
+ protected int getCreditCardUseCountForTesting(String guid) { |
please use gerrit instead
2016/07/12 15:41:57
Remove "protected"
sebsg
2016/07/13 18:49:19
Done.
|
+ ThreadUtils.assertOnUiThread(); |
+ return nativeGetCreditCardUseCountForTesting(mPersonalDataManagerAndroid, guid); |
+ } |
+ |
+ @VisibleForTesting |
+ protected long getCreditCardUseDateForTesting(String guid) { |
please use gerrit instead
2016/07/12 15:41:57
ditto
sebsg
2016/07/13 18:49:19
Done.
|
+ ThreadUtils.assertOnUiThread(); |
+ return nativeGetCreditCardUseDateForTesting(mPersonalDataManagerAndroid, guid); |
+ } |
+ |
+ @VisibleForTesting |
+ protected long getCurrentDateForTesting() { |
please use gerrit instead
2016/07/12 15:41:57
ditto
sebsg
2016/07/13 18:49:19
Done.
|
+ ThreadUtils.assertOnUiThread(); |
+ return nativeGetCurrentDateForTesting(mPersonalDataManagerAndroid); |
+ } |
+ |
/** |
* @return Whether the Autofill feature is enabled. |
*/ |
@@ -710,10 +762,23 @@ public class PersonalDataManager { |
private native void nativeAddServerCreditCardForTest(long nativePersonalDataManagerAndroid, |
CreditCard card); |
private native void nativeRemoveByGUID(long nativePersonalDataManagerAndroid, String guid); |
+ private native void nativeRecordAndLogProfileUse(long nativePersonalDataManagerAndroid, |
+ String guid); |
private native void nativeSetProfileUseStatsForTesting( |
long nativePersonalDataManagerAndroid, String guid, int count, long date); |
+ private native int nativeGetProfileUseCountForTesting(long nativePersonalDataManagerAndroid, |
+ String guid); |
+ private native long nativeGetProfileUseDateForTesting(long nativePersonalDataManagerAndroid, |
+ String guid); |
+ private native void nativeRecordAndLogCreditCardUse(long nativePersonalDataManagerAndroid, |
+ String guid); |
private native void nativeSetCreditCardUseStatsForTesting( |
long nativePersonalDataManagerAndroid, String guid, int count, long date); |
+ private native int nativeGetCreditCardUseCountForTesting(long nativePersonalDataManagerAndroid, |
+ String guid); |
+ private native long nativeGetCreditCardUseDateForTesting(long nativePersonalDataManagerAndroid, |
+ String guid); |
+ private native long nativeGetCurrentDateForTesting(long nativePersonalDataManagerAndroid); |
private native void nativeClearUnmaskedCache( |
long nativePersonalDataManagerAndroid, String guid); |
private native void nativeGetFullCardForPaymentRequest(long nativePersonalDataManagerAndroid, |