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

Unified Diff: chrome/browser/autofill/android/personal_data_manager_android.h

Issue 2126213002: [Payments] Record use of profiles and credit cards in Payment Request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed temp card bug + nits Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/android/personal_data_manager_android.h
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.h b/chrome/browser/autofill/android/personal_data_manager_android.h
index 9a05ce69e6d584857853bba63c44292de3e2a042..755ed7b3532cb81fc4b33b6aaf5df14e12ecc43a 100644
--- a/chrome/browser/autofill/android/personal_data_manager_android.h
+++ b/chrome/browser/autofill/android/personal_data_manager_android.h
@@ -179,6 +179,17 @@ class PersonalDataManagerAndroid : public PersonalDataManagerObserver {
// Registers the JNI bindings for this class.
static bool Register(JNIEnv* env);
+ // These functions act on the usage stats of local profiles and credit cards.
+ // --------------------
+
+ // Records the use and log usage metrics for the profile associated with the
+ // |jguid|. Increments the use count of the profile and sets its use date to
+ // the current time.
+ void RecordAndLogProfileUse(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj,
+ const base::android::JavaParamRef<jstring>& jguid);
+
// Sets the use count and use date of the profile associated to the |jguid|.
// Both |count| and |date| should be non-negative. |date| represents an
// absolute point in coordinated universal time (UTC) represented as
@@ -191,6 +202,29 @@ class PersonalDataManagerAndroid : public PersonalDataManagerObserver {
jint count,
jint date);
+ // Returns the use count of the profile associated to the |jguid|.
+ jint GetProfileUseCountForTesting(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj,
+ const base::android::JavaParamRef<jstring>& jguid);
+
+ // Returns the use date of the profile associated to the |jguid|. It
+ // represents an absolute point in coordinated universal time (UTC)
+ // represented as microseconds since the Windows epoch. For more details see
+ // the comment header in time.h.
+ jlong GetProfileUseDateForTesting(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj,
+ const base::android::JavaParamRef<jstring>& jguid);
+
+ // Records the use and log usage metrics for the credit card associated with
+ // the |jguid|. Increments the use count of the credit card and sets its use
+ // date to the current time.
+ void RecordAndLogCreditCardUse(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj,
+ const base::android::JavaParamRef<jstring>& jguid);
+
// Sets the use count and use date of the credit card associated to the
// |jguid|. Both |count| and |date| should be non-negative. |date| represents
// an absolute point in coordinated universal time (UTC) represented as
@@ -203,6 +237,28 @@ class PersonalDataManagerAndroid : public PersonalDataManagerObserver {
jint count,
jint date);
+ // Returns the use count of the credit card associated to the |jguid|.
+ jint GetCreditCardUseCountForTesting(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj,
+ const base::android::JavaParamRef<jstring>& jguid);
+
+ // Returns the use date of the credit card associated to the |jguid|. It
+ // represents an absolute point in coordinated universal time (UTC)
+ // represented as microseconds since the Windows epoch. For more details see
+ // the comment header in time.h.
+ jlong GetCreditCardUseDateForTesting(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj,
+ const base::android::JavaParamRef<jstring>& jguid);
+
+ // Returns the current date represented as an absolute point in coordinated
+ // universal time (UTC) represented as microseconds since the Unix epoch. For
+ // more details see the comment header in time.h
+ jlong GetCurrentDateForTesting(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& unused_obj);
+
private:
~PersonalDataManagerAndroid() override;

Powered by Google App Engine
This is Rietveld 408576698