Chromium Code Reviews| 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" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 JNIEnv* env, | 89 JNIEnv* env, |
| 90 const base::android::JavaParamRef<jobject>& unused_obj); | 90 const base::android::JavaParamRef<jobject>& unused_obj); |
| 91 | 91 |
| 92 // Returns the credit card with the specified |jguid|, or NULL if there is | 92 // Returns the credit card with the specified |jguid|, or NULL if there is |
| 93 // no credit card with the specified |jguid|. | 93 // no credit card with the specified |jguid|. |
| 94 base::android::ScopedJavaLocalRef<jobject> GetCreditCardByGUID( | 94 base::android::ScopedJavaLocalRef<jobject> GetCreditCardByGUID( |
| 95 JNIEnv* env, | 95 JNIEnv* env, |
| 96 const base::android::JavaParamRef<jobject>& unused_obj, | 96 const base::android::JavaParamRef<jobject>& unused_obj, |
| 97 const base::android::JavaParamRef<jstring>& jguid); | 97 const base::android::JavaParamRef<jstring>& jguid); |
| 98 | 98 |
| 99 // Returns a credit card with the specified |jcard_number|. This is used for | |
| 100 // determining the card's obfuscated number, issuer icon, and type in one go. | |
| 101 // This function does not interact with the autofill table on disk, so can be | |
| 102 // used for cards that are not saved. | |
| 103 base::android::ScopedJavaLocalRef<jobject> GetCreditCardForNumber( | |
| 104 JNIEnv* env, | |
| 105 const base::android::JavaParamRef<jobject>& unused_obj, | |
| 106 const base::android::JavaParamRef<jstring>& jcard_number); | |
| 107 | |
| 99 // Adds or modifies a local credit card. If |jguid| is an empty string, we | 108 // Adds or modifies a local credit card. If |jguid| is an empty string, we |
| 100 // are creating a new card. Else we are updating an existing profile. Always | 109 // are creating a new card. Else we are updating an existing profile. Always |
| 101 // returns the GUID for this profile; the GUID it may have just been created. | 110 // returns the GUID for this profile; the GUID it may have just been created. |
| 102 base::android::ScopedJavaLocalRef<jstring> SetCreditCard( | 111 base::android::ScopedJavaLocalRef<jstring> SetCreditCard( |
| 103 JNIEnv* env, | 112 JNIEnv* env, |
| 104 const base::android::JavaParamRef<jobject>& unused_obj, | 113 const base::android::JavaParamRef<jobject>& unused_obj, |
| 105 const base::android::JavaParamRef<jobject>& jcard); | 114 const base::android::JavaParamRef<jobject>& jcard); |
| 106 | 115 |
| 107 // Updates the billing address of a server credit card with GUID |jguid|. | 116 // Updates the billing address of a server credit card with GUID |jguid|. |
| 108 void UpdateServerCardBillingAddress(JNIEnv* env, | 117 void UpdateServerCardBillingAddress( |
| 118 JNIEnv* env, | |
| 109 const base::android::JavaParamRef<jobject>& unused_obj, | 119 const base::android::JavaParamRef<jobject>& unused_obj, |
| 110 const base::android::JavaParamRef<jstring>& jguid, | 120 const base::android::JavaParamRef<jstring>& jguid, |
| 111 const base::android::JavaParamRef<jstring>& jbilling_address_id); | 121 const base::android::JavaParamRef<jstring>& jbilling_address_id); |
| 112 | 122 |
| 123 // Returns the card type according to PaymentRequest spec, or an empty string | |
| 124 // if the given card number is not valid. | |
| 125 base::android::ScopedJavaLocalRef<jstring> GetBasicCardPaymentTypeIfValid( | |
| 126 JNIEnv* env, | |
| 127 const base::android::JavaParamRef<jobject>& unused_obj, | |
| 128 const base::android::JavaParamRef<jstring>& jcard_number); | |
| 129 | |
| 113 // Adds a server credit card. Used only in tests. | 130 // Adds a server credit card. Used only in tests. |
| 114 void AddServerCreditCardForTest( | 131 void AddServerCreditCardForTest( |
| 115 JNIEnv* env, | 132 JNIEnv* env, |
| 116 const base::android::JavaParamRef<jobject>& unused_obj, | 133 const base::android::JavaParamRef<jobject>& unused_obj, |
| 117 const base::android::JavaParamRef<jobject>& jcard); | 134 const base::android::JavaParamRef<jobject>& jcard); |
| 118 | 135 |
| 119 // Removes the profile or credit card represented by |jguid|. | 136 // Removes the profile or credit card represented by |jguid|. |
| 120 void RemoveByGUID(JNIEnv* env, | 137 void RemoveByGUID(JNIEnv* env, |
| 121 const base::android::JavaParamRef<jobject>& unused_obj, | 138 const base::android::JavaParamRef<jobject>& unused_obj, |
| 122 const base::android::JavaParamRef<jstring>& jguid); | 139 const base::android::JavaParamRef<jstring>& jguid); |
| 123 | 140 |
| 124 // Resets the given unmasked card back to the masked state. | 141 // Resets the given unmasked card back to the masked state. |
| 125 void ClearUnmaskedCache( | 142 void ClearUnmaskedCache( |
| 126 JNIEnv* env, | 143 JNIEnv* env, |
| 127 const base::android::JavaParamRef<jobject>& unused_obj, | 144 const base::android::JavaParamRef<jobject>& unused_obj, |
| 128 const base::android::JavaParamRef<jstring>& jguid); | 145 const base::android::JavaParamRef<jstring>& jguid); |
| 129 | 146 |
| 130 // Gets the card CVC and unmasks the card (if it's masked). | 147 // Gets the card CVC and unmasks the card (if it's masked). |
| 131 void GetFullCardForPaymentRequest( | 148 void GetFullCardForPaymentRequest( |
| 132 JNIEnv* env, | 149 JNIEnv* env, |
| 133 const base::android::JavaParamRef<jobject>& unused_obj, | 150 const base::android::JavaParamRef<jobject>& unused_obj, |
| 134 const base::android::JavaParamRef<jobject>& jweb_contents, | 151 const base::android::JavaParamRef<jobject>& jweb_contents, |
| 135 const base::android::JavaParamRef<jstring>& jguid, | 152 const base::android::JavaParamRef<jstring>& jguid, |
| 136 const base::android::JavaParamRef<jobject>& jdelegate); | 153 const base::android::JavaParamRef<jobject>& jdelegate); |
| 137 | 154 |
| 155 // Gets the CVC for a card that's temporary and not stored on disk. The card | |
|
Mathieu
2016/07/13 16:32:45
reword? Currently comment says "gets the CVC" whil
please use gerrit instead
2016/07/13 16:57:56
Reworded.
| |
| 156 // number is used for showing a title in the CVC prompt, e.g., | |
| 157 // "Pay with Visa***1111". | |
| 158 void GetFullTemporaryCardForPaymentRequest( | |
| 159 JNIEnv* env, | |
| 160 const base::android::JavaParamRef<jobject>& unused_obj, | |
| 161 const base::android::JavaParamRef<jobject>& jweb_contents, | |
| 162 const base::android::JavaParamRef<jstring>& jcard_number, | |
| 163 const base::android::JavaParamRef<jstring>& jname_on_card, | |
| 164 const base::android::JavaParamRef<jstring>& jexpiration_month, | |
| 165 const base::android::JavaParamRef<jstring>& jexpiration_year, | |
| 166 const base::android::JavaParamRef<jobject>& jdelegate); | |
| 167 | |
| 138 // PersonalDataManagerObserver: | 168 // PersonalDataManagerObserver: |
| 139 void OnPersonalDataChanged() override; | 169 void OnPersonalDataChanged() override; |
| 140 | 170 |
| 141 // Registers the JNI bindings for this class. | 171 // Registers the JNI bindings for this class. |
| 142 static bool Register(JNIEnv* env); | 172 static bool Register(JNIEnv* env); |
| 143 | 173 |
| 144 // Sets the use count and use date of the profile associated to the |jguid|. | 174 // Sets the use count and use date of the profile associated to the |jguid|. |
| 145 // Both |count| and |date| should be non-negative. |date| represents an | 175 // Both |count| and |date| should be non-negative. |date| represents an |
| 146 // absolute point in coordinated universal time (UTC) represented as | 176 // absolute point in coordinated universal time (UTC) represented as |
| 147 // microseconds since the Windows epoch. For more details see the comment | 177 // microseconds since the Windows epoch. For more details see the comment |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 | 225 |
| 196 // Pointer to the PersonalDataManager for the main profile. | 226 // Pointer to the PersonalDataManager for the main profile. |
| 197 PersonalDataManager* personal_data_manager_; | 227 PersonalDataManager* personal_data_manager_; |
| 198 | 228 |
| 199 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); | 229 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); |
| 200 }; | 230 }; |
| 201 | 231 |
| 202 } // namespace autofill | 232 } // namespace autofill |
| 203 | 233 |
| 204 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ | 234 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ |
| OLD | NEW |