| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ | 6 #define CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_weak_ref.h" | 8 #include "base/android/jni_weak_ref.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "components/autofill/core/browser/personal_data_manager.h" | 12 #include "components/autofill/core/browser/personal_data_manager.h" |
| 13 #include "components/autofill/core/browser/personal_data_manager_observer.h" | 13 #include "components/autofill/core/browser/personal_data_manager_observer.h" |
| 14 #include "components/payments/core/address_normalizer.h" | 14 #include "components/payments/core/address_normalizer.h" |
| 15 | 15 |
| 16 namespace autofill { | 16 namespace autofill { |
| 17 | 17 |
| 18 // Android wrapper of the PersonalDataManager which provides access from the | 18 // Android wrapper of the PersonalDataManager which provides access from the |
| 19 // Java layer. Note that on Android, there's only a single profile, and | 19 // Java layer. Note that on Android, there's only a single profile, and |
| 20 // therefore a single instance of this wrapper. | 20 // therefore a single instance of this wrapper. |
| 21 class PersonalDataManagerAndroid : public PersonalDataManagerObserver { | 21 class PersonalDataManagerAndroid : public PersonalDataManagerObserver { |
| 22 public: | 22 public: |
| 23 // Registers the JNI bindings for this class. |
| 24 static bool Register(JNIEnv* env); |
| 25 |
| 23 PersonalDataManagerAndroid(JNIEnv* env, jobject obj); | 26 PersonalDataManagerAndroid(JNIEnv* env, jobject obj); |
| 24 | 27 |
| 25 // Returns true if personal data manager has loaded the initial data. | 28 // Returns true if personal data manager has loaded the initial data. |
| 26 jboolean IsDataLoaded( | 29 jboolean IsDataLoaded( |
| 27 JNIEnv* env, | 30 JNIEnv* env, |
| 28 const base::android::JavaParamRef<jobject>& unused_obj) const; | 31 const base::android::JavaParamRef<jobject>& unused_obj) const; |
| 29 | 32 |
| 30 // These functions act on "web profiles" aka "LOCAL_PROFILE" profiles. | 33 // These functions act on "web profiles" aka "LOCAL_PROFILE" profiles. |
| 31 // ------------------------- | 34 // ------------------------- |
| 32 | 35 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 void GetFullCardForPaymentRequest( | 192 void GetFullCardForPaymentRequest( |
| 190 JNIEnv* env, | 193 JNIEnv* env, |
| 191 const base::android::JavaParamRef<jobject>& unused_obj, | 194 const base::android::JavaParamRef<jobject>& unused_obj, |
| 192 const base::android::JavaParamRef<jobject>& jweb_contents, | 195 const base::android::JavaParamRef<jobject>& jweb_contents, |
| 193 const base::android::JavaParamRef<jobject>& jcard, | 196 const base::android::JavaParamRef<jobject>& jcard, |
| 194 const base::android::JavaParamRef<jobject>& jdelegate); | 197 const base::android::JavaParamRef<jobject>& jdelegate); |
| 195 | 198 |
| 196 // PersonalDataManagerObserver: | 199 // PersonalDataManagerObserver: |
| 197 void OnPersonalDataChanged() override; | 200 void OnPersonalDataChanged() override; |
| 198 | 201 |
| 199 // Registers the JNI bindings for this class. | |
| 200 static bool Register(JNIEnv* env); | |
| 201 | |
| 202 // These functions act on the usage stats of local profiles and credit cards. | 202 // These functions act on the usage stats of local profiles and credit cards. |
| 203 // -------------------- | 203 // -------------------- |
| 204 | 204 |
| 205 // Records the use and log usage metrics for the profile associated with the | 205 // Records the use and log usage metrics for the profile associated with the |
| 206 // |jguid|. Increments the use count of the profile and sets its use date to | 206 // |jguid|. Increments the use count of the profile and sets its use date to |
| 207 // the current time. | 207 // the current time. |
| 208 void RecordAndLogProfileUse( | 208 void RecordAndLogProfileUse( |
| 209 JNIEnv* env, | 209 JNIEnv* env, |
| 210 const base::android::JavaParamRef<jobject>& unused_obj, | 210 const base::android::JavaParamRef<jobject>& unused_obj, |
| 211 const base::android::JavaParamRef<jstring>& jguid); | 211 const base::android::JavaParamRef<jstring>& jguid); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 // The address validator used to normalize addresses. | 362 // The address validator used to normalize addresses. |
| 363 payments::AddressNormalizer address_normalizer_; | 363 payments::AddressNormalizer address_normalizer_; |
| 364 | 364 |
| 365 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); | 365 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); |
| 366 }; | 366 }; |
| 367 | 367 |
| 368 } // namespace autofill | 368 } // namespace autofill |
| 369 | 369 |
| 370 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ | 370 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ |
| OLD | NEW |