Chromium Code Reviews| 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 d618f4da42fa788862c1aadd461d9f50c7740186..a9a4d8db2cd53f720bcbac98919e5ca43984f432 100644 |
| --- a/chrome/browser/autofill/android/personal_data_manager_android.h |
| +++ b/chrome/browser/autofill/android/personal_data_manager_android.h |
| @@ -23,16 +23,16 @@ class PersonalDataManagerAndroid : public PersonalDataManagerObserver { |
| // These functions act on "web profiles" aka "LOCAL_PROFILE" profiles. |
| // ------------------------- |
| - // Returns the number of web and auxiliary profiles. |
| - jint GetProfileCount(JNIEnv* unused_env, |
| - const base::android::JavaParamRef<jobject>& unused_obj); |
| + // Returns the GUIDs of all profiles. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetProfileGUIDsForSettings( |
| + JNIEnv* env, |
| + const base::android::JavaParamRef<jobject>& unused_obj); |
| - // Returns the profile as indexed by |index| in the PersonalDataManager's |
| - // |GetProfiles()| collection. |
| - base::android::ScopedJavaLocalRef<jobject> GetProfileByIndex( |
| + // Returns the GUIDs of the profiles to suggest to the user. See |
| + // PersonalDataManager::GetProfilesToSuggest for more details. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetProfileGUIDsToSuggest( |
| JNIEnv* env, |
| - const base::android::JavaParamRef<jobject>& unused_obj, |
| - jint index); |
| + const base::android::JavaParamRef<jobject>& unused_obj); |
| // Returns the profile with the specified |jguid|, or NULL if there is no |
| // profile with the specified |jguid|. Both web and auxiliary profiles may |
| @@ -57,7 +57,19 @@ class PersonalDataManagerAndroid : public PersonalDataManagerObserver { |
| // |
| // If |address_only| is true, then such fields as phone number and email |
| // address are also omitted, but all fields are included in the label. |
| - base::android::ScopedJavaLocalRef<jobjectArray> GetProfileLabels( |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetProfileLabelsForSettings( |
| + JNIEnv* env, |
| + const base::android::JavaParamRef<jobject>& unused_obj, |
| + bool address_only); |
|
please use gerrit instead
2016/05/27 21:47:30
This param will be always false, so there's no nee
sebsg
2016/05/31 15:26:14
Done.
|
| + |
| + // Gets the labels for the profiles to suggest to the user. These labels are |
| + // useful for distinguishing the profiles from one another. |
| + // |
| + // The labels never contain the full name and include at least 2 fields. |
| + // |
| + // If |address_only| is true, then such fields as phone number and email |
| + // address are also omitted, but all fields are included in the label. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetProfileLabelsToSuggest( |
| JNIEnv* env, |
| const base::android::JavaParamRef<jobject>& unused_obj, |
| bool address_only); |
|
please use gerrit instead
2016/05/27 21:47:30
This param will be always true, so there's no need
sebsg
2016/05/31 15:26:14
Done.
|
| @@ -65,17 +77,16 @@ class PersonalDataManagerAndroid : public PersonalDataManagerObserver { |
| // These functions act on local credit cards. |
| // -------------------- |
| - // Returns the number of credit cards. |
| - jint GetCreditCardCount( |
| - JNIEnv* unused_env, |
| - const base::android::JavaParamRef<jobject>& unused_obj); |
| + // Returns the GUIDs of all the credit cards. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetCreditCardGUIDsForSettings( |
| + JNIEnv* env, |
| + const base::android::JavaParamRef<jobject>& unused_ob); |
|
please use gerrit instead
2016/05/27 21:47:30
s/unused_ob/unused_obj/
sebsg
2016/05/31 15:26:14
Done.
|
| - // Returns the credit card as indexed by |index| in the PersonalDataManager's |
| - // |GetCreditCards()| collection. |
| - base::android::ScopedJavaLocalRef<jobject> GetCreditCardByIndex( |
| + // Returns the GUIDs of the credit cards to suggest to the user. See |
| + // PersonalDataManager::GetCreditCardsToSuggest for more details. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetCreditCardGUIDsToSuggest( |
| JNIEnv* env, |
| - const base::android::JavaParamRef<jobject>& unused_obj, |
| - jint index); |
| + const base::android::JavaParamRef<jobject>& unused_ob); |
|
please use gerrit instead
2016/05/27 21:47:30
s/unused_ob/unused_obj/
sebsg
2016/05/31 15:26:14
Done.
|
| // Returns the credit card with the specified |jguid|, or NULL if there is |
| // no credit card with the specified |jguid|. |
| @@ -123,9 +134,55 @@ class PersonalDataManagerAndroid : public PersonalDataManagerObserver { |
| // Registers the JNI bindings for this class. |
| static bool Register(JNIEnv* env); |
| + // 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 |
| + // microseconds since the Windows epoch. For more details see the comment |
| + // header in time.h. |
| + void SetProfileUseStatsForTesting( |
| + JNIEnv* env, |
| + const base::android::JavaParamRef<jobject>& unused_obj, |
| + const base::android::JavaParamRef<jstring>& jguid, |
| + jint count, |
| + jint date); |
| + |
| + // 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 |
| + // microseconds since the Windows epoch. For more details see the comment |
| + // header in time.h. |
| + void SetCreditCardUseStatsForTesting( |
| + JNIEnv* env, |
| + const base::android::JavaParamRef<jobject>& unused_obj, |
| + const base::android::JavaParamRef<jstring>& jguid, |
| + jint count, |
| + jint date); |
| + |
| private: |
| ~PersonalDataManagerAndroid() override; |
| + // Returns the GUIDs of the |profiles| passed as parameter. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetProfileGUIDs( |
| + JNIEnv* env, |
| + const std::vector<AutofillProfile*>& profiles); |
| + |
| + // Returns the GUIDs of the |credit_cards| passed as parameter. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetCreditCardGUIDs( |
| + JNIEnv* env, |
| + const std::vector<CreditCard*>& credit_cards); |
| + |
| + // Gets the labels for the |profiles| passed as paremeters. These labels are |
| + // useful for distinguishing the profiles from one another. |
| + // |
| + // The labels never contain the full name and include at least 2 fields. |
| + // |
| + // If |address_only| is true, then such fields as phone number and email |
| + // address are also omitted, but all fields are included in the label. |
| + base::android::ScopedJavaLocalRef<jobjectArray> GetProfileLabels( |
| + JNIEnv* env, |
| + bool address_only, |
| + std::vector<AutofillProfile*> profiles); |
| + |
| // Pointer to the java counterpart. |
| JavaObjectWeakGlobalRef weak_java_obj_; |