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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 const base::android::JavaParamRef<jstring>& jcard_number); | 106 const base::android::JavaParamRef<jstring>& jcard_number); |
107 | 107 |
108 // 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 |
109 // 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 |
110 // 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. |
111 base::android::ScopedJavaLocalRef<jstring> SetCreditCard( | 111 base::android::ScopedJavaLocalRef<jstring> SetCreditCard( |
112 JNIEnv* env, | 112 JNIEnv* env, |
113 const base::android::JavaParamRef<jobject>& unused_obj, | 113 const base::android::JavaParamRef<jobject>& unused_obj, |
114 const base::android::JavaParamRef<jobject>& jcard); | 114 const base::android::JavaParamRef<jobject>& jcard); |
115 | 115 |
116 // Updates the billing address of a server credit card with GUID |jguid|. | 116 // Updates the billing address of a server credit card with server ID |
| 117 // |jcard_server_id|. |
117 void UpdateServerCardBillingAddress( | 118 void UpdateServerCardBillingAddress( |
118 JNIEnv* env, | 119 JNIEnv* env, |
119 const base::android::JavaParamRef<jobject>& unused_obj, | 120 const base::android::JavaParamRef<jobject>& unused_obj, |
120 const base::android::JavaParamRef<jstring>& jguid, | 121 const base::android::JavaParamRef<jstring>& jcard_server_id, |
121 const base::android::JavaParamRef<jstring>& jbilling_address_id); | 122 const base::android::JavaParamRef<jstring>& jbilling_address_id); |
122 | 123 |
123 // Returns the card type according to PaymentRequest spec, or an empty string | 124 // Returns the card type according to PaymentRequest spec, or an empty string |
124 // if the given card number is not valid. | 125 // if the given card number is not valid. |
125 base::android::ScopedJavaLocalRef<jstring> GetBasicCardPaymentTypeIfValid( | 126 base::android::ScopedJavaLocalRef<jstring> GetBasicCardPaymentTypeIfValid( |
126 JNIEnv* env, | 127 JNIEnv* env, |
127 const base::android::JavaParamRef<jobject>& unused_obj, | 128 const base::android::JavaParamRef<jobject>& unused_obj, |
128 const base::android::JavaParamRef<jstring>& jcard_number); | 129 const base::android::JavaParamRef<jstring>& jcard_number); |
129 | 130 |
130 // Adds a server credit card. Used only in tests. | 131 // Adds a server credit card. Used only in tests. |
(...skipping 15 matching lines...) Expand all Loading... |
146 | 147 |
147 // Gets the card CVC and expiration date (if it's expired). If the card is | 148 // Gets the card CVC and expiration date (if it's expired). If the card is |
148 // masked, unmasks it. If the user has entered new expiration date, the new | 149 // masked, unmasks it. If the user has entered new expiration date, the new |
149 // date is saved on disk. | 150 // date is saved on disk. |
150 // | 151 // |
151 // The full card details are sent to the delegate. | 152 // The full card details are sent to the delegate. |
152 void GetFullCardForPaymentRequest( | 153 void GetFullCardForPaymentRequest( |
153 JNIEnv* env, | 154 JNIEnv* env, |
154 const base::android::JavaParamRef<jobject>& unused_obj, | 155 const base::android::JavaParamRef<jobject>& unused_obj, |
155 const base::android::JavaParamRef<jobject>& jweb_contents, | 156 const base::android::JavaParamRef<jobject>& jweb_contents, |
156 const base::android::JavaParamRef<jstring>& jguid, | 157 const base::android::JavaParamRef<jobject>& jcard, |
157 const base::android::JavaParamRef<jobject>& jdelegate); | |
158 | |
159 // Gets the card CVC and expiration date (if it's expired) for a card that's | |
160 // temporary and not stored on disk. No unmasking is performed. If the user | |
161 // has entered new expiration date, the new date is not saved on disk, because | |
162 // this card is temporary. | |
163 // | |
164 // The card number, name on card, and expiration date are used for UI display | |
165 // and are sent to the delegate after user confirms their CVC. | |
166 void GetFullTemporaryCardForPaymentRequest( | |
167 JNIEnv* env, | |
168 const base::android::JavaParamRef<jobject>& unused_obj, | |
169 const base::android::JavaParamRef<jobject>& jweb_contents, | |
170 const base::android::JavaParamRef<jstring>& jcard_number, | |
171 const base::android::JavaParamRef<jstring>& jname_on_card, | |
172 const base::android::JavaParamRef<jstring>& jexpiration_month, | |
173 const base::android::JavaParamRef<jstring>& jexpiration_year, | |
174 const base::android::JavaParamRef<jobject>& jdelegate); | 158 const base::android::JavaParamRef<jobject>& jdelegate); |
175 | 159 |
176 // PersonalDataManagerObserver: | 160 // PersonalDataManagerObserver: |
177 void OnPersonalDataChanged() override; | 161 void OnPersonalDataChanged() override; |
178 | 162 |
179 // Registers the JNI bindings for this class. | 163 // Registers the JNI bindings for this class. |
180 static bool Register(JNIEnv* env); | 164 static bool Register(JNIEnv* env); |
181 | 165 |
182 // These functions act on the usage stats of local profiles and credit cards. | 166 // These functions act on the usage stats of local profiles and credit cards. |
183 // -------------------- | 167 // -------------------- |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 273 |
290 // Pointer to the PersonalDataManager for the main profile. | 274 // Pointer to the PersonalDataManager for the main profile. |
291 PersonalDataManager* personal_data_manager_; | 275 PersonalDataManager* personal_data_manager_; |
292 | 276 |
293 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); | 277 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); |
294 }; | 278 }; |
295 | 279 |
296 } // namespace autofill | 280 } // namespace autofill |
297 | 281 |
298 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ | 282 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ |
OLD | NEW |