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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 const base::android::JavaParamRef<jobject>& jweb_contents, | 134 const base::android::JavaParamRef<jobject>& jweb_contents, |
135 const base::android::JavaParamRef<jstring>& jguid, | 135 const base::android::JavaParamRef<jstring>& jguid, |
136 const base::android::JavaParamRef<jobject>& jdelegate); | 136 const base::android::JavaParamRef<jobject>& jdelegate); |
137 | 137 |
138 // PersonalDataManagerObserver: | 138 // PersonalDataManagerObserver: |
139 void OnPersonalDataChanged() override; | 139 void OnPersonalDataChanged() override; |
140 | 140 |
141 // Registers the JNI bindings for this class. | 141 // Registers the JNI bindings for this class. |
142 static bool Register(JNIEnv* env); | 142 static bool Register(JNIEnv* env); |
143 | 143 |
144 // Record the use and log usage metrics for the profile associated with the | |
please use gerrit instead
2016/07/12 15:41:58
Records
sebsg
2016/07/13 18:49:20
Done.
| |
145 // |jguid|. Increments the use count of the profile and sets its use date to | |
146 // the current time. | |
147 void RecordAndLogProfileUse( | |
please use gerrit instead
2016/07/12 15:41:59
Line 78 above says "These functions act on local c
sebsg
2016/07/13 18:49:20
Done.
| |
148 JNIEnv* env, | |
149 const base::android::JavaParamRef<jobject>& unused_obj, | |
150 const base::android::JavaParamRef<jstring>& jguid); | |
151 | |
144 // Sets the use count and use date of the profile associated to the |jguid|. | 152 // 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 | 153 // Both |count| and |date| should be non-negative. |date| represents an |
146 // absolute point in coordinated universal time (UTC) represented as | 154 // absolute point in coordinated universal time (UTC) represented as |
147 // microseconds since the Windows epoch. For more details see the comment | 155 // microseconds since the Windows epoch. For more details see the comment |
148 // header in time.h. | 156 // header in time.h. |
149 void SetProfileUseStatsForTesting( | 157 void SetProfileUseStatsForTesting( |
150 JNIEnv* env, | 158 JNIEnv* env, |
151 const base::android::JavaParamRef<jobject>& unused_obj, | 159 const base::android::JavaParamRef<jobject>& unused_obj, |
152 const base::android::JavaParamRef<jstring>& jguid, | 160 const base::android::JavaParamRef<jstring>& jguid, |
153 jint count, | 161 jint count, |
154 jint date); | 162 jint date); |
155 | 163 |
164 // Returns the use count of the profile associated to the |jguid|. | |
165 jint GetProfileUseCountForTesting( | |
166 JNIEnv* env, | |
167 const base::android::JavaParamRef<jobject>& unused_obj, | |
168 const base::android::JavaParamRef<jstring>& jguid); | |
169 | |
170 // Returns the use date of the profile associated to the |jguid|. It | |
171 // represents an absolute point in coordinated universal time (UTC) | |
172 // represented as microseconds since the Windows epoch. For more details see | |
173 // the comment header in time.h. | |
174 jlong GetProfileUseDateForTesting( | |
175 JNIEnv* env, | |
176 const base::android::JavaParamRef<jobject>& unused_obj, | |
177 const base::android::JavaParamRef<jstring>& jguid); | |
178 | |
179 // Record the use and log usage metrics for the credit card associated with | |
please use gerrit instead
2016/07/12 15:41:59
Records
sebsg
2016/07/13 18:49:20
Done.
| |
180 // the |jguid|. Increments the use count of the credit card and sets its use | |
181 // date to the current time. | |
182 void RecordAndLogCreditCardUse( | |
183 JNIEnv* env, | |
184 const base::android::JavaParamRef<jobject>& unused_obj, | |
185 const base::android::JavaParamRef<jstring>& jguid); | |
186 | |
156 // Sets the use count and use date of the credit card associated to the | 187 // Sets the use count and use date of the credit card associated to the |
157 // |jguid|. Both |count| and |date| should be non-negative. |date| represents | 188 // |jguid|. Both |count| and |date| should be non-negative. |date| represents |
158 // an absolute point in coordinated universal time (UTC) represented as | 189 // an absolute point in coordinated universal time (UTC) represented as |
159 // microseconds since the Windows epoch. For more details see the comment | 190 // microseconds since the Windows epoch. For more details see the comment |
160 // header in time.h. | 191 // header in time.h. |
161 void SetCreditCardUseStatsForTesting( | 192 void SetCreditCardUseStatsForTesting( |
162 JNIEnv* env, | 193 JNIEnv* env, |
163 const base::android::JavaParamRef<jobject>& unused_obj, | 194 const base::android::JavaParamRef<jobject>& unused_obj, |
164 const base::android::JavaParamRef<jstring>& jguid, | 195 const base::android::JavaParamRef<jstring>& jguid, |
165 jint count, | 196 jint count, |
166 jint date); | 197 jint date); |
167 | 198 |
199 // Returns the use count of the credit card associated to the |jguid|. | |
200 jint GetCreditCardUseCountForTesting( | |
201 JNIEnv* env, | |
202 const base::android::JavaParamRef<jobject>& unused_obj, | |
203 const base::android::JavaParamRef<jstring>& jguid); | |
204 | |
205 // Returns the use date of the credit card associated to the |jguid|. It | |
206 // represents an absolute point in coordinated universal time (UTC) | |
207 // represented as microseconds since the Windows epoch. For more details see | |
208 // the comment header in time.h. | |
209 jlong GetCreditCardUseDateForTesting( | |
210 JNIEnv* env, | |
211 const base::android::JavaParamRef<jobject>& unused_obj, | |
212 const base::android::JavaParamRef<jstring>& jguid); | |
213 | |
214 // Returns the current date represented as an absolute point in coordinated | |
215 // universal time (UTC) represented as microseconds since the Windows epoch. | |
216 // For more details see the comment header in time.h | |
217 jlong GetCurrentDateForTesting( | |
218 JNIEnv* env, | |
219 const base::android::JavaParamRef<jobject>& unused_obj); | |
220 | |
168 private: | 221 private: |
169 ~PersonalDataManagerAndroid() override; | 222 ~PersonalDataManagerAndroid() override; |
170 | 223 |
171 // Returns the GUIDs of the |profiles| passed as parameter. | 224 // Returns the GUIDs of the |profiles| passed as parameter. |
172 base::android::ScopedJavaLocalRef<jobjectArray> GetProfileGUIDs( | 225 base::android::ScopedJavaLocalRef<jobjectArray> GetProfileGUIDs( |
173 JNIEnv* env, | 226 JNIEnv* env, |
174 const std::vector<AutofillProfile*>& profiles); | 227 const std::vector<AutofillProfile*>& profiles); |
175 | 228 |
176 // Returns the GUIDs of the |credit_cards| passed as parameter. | 229 // Returns the GUIDs of the |credit_cards| passed as parameter. |
177 base::android::ScopedJavaLocalRef<jobjectArray> GetCreditCardGUIDs( | 230 base::android::ScopedJavaLocalRef<jobjectArray> GetCreditCardGUIDs( |
(...skipping 17 matching lines...) Expand all Loading... | |
195 | 248 |
196 // Pointer to the PersonalDataManager for the main profile. | 249 // Pointer to the PersonalDataManager for the main profile. |
197 PersonalDataManager* personal_data_manager_; | 250 PersonalDataManager* personal_data_manager_; |
198 | 251 |
199 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); | 252 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); |
200 }; | 253 }; |
201 | 254 |
202 } // namespace autofill | 255 } // namespace autofill |
203 | 256 |
204 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ | 257 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_PERSONAL_DATA_MANAGER_ANDROID_H_ |
OLD | NEW |