OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 108 |
109 // Returns the value of the AutofillEnabled pref. | 109 // Returns the value of the AutofillEnabled pref. |
110 virtual bool IsAutofillEnabled() const; | 110 virtual bool IsAutofillEnabled() const; |
111 | 111 |
112 // Uploads the form data to the Autofill server. | 112 // Uploads the form data to the Autofill server. |
113 virtual void UploadFormData(const FormStructure& submitted_form); | 113 virtual void UploadFormData(const FormStructure& submitted_form); |
114 | 114 |
115 // Reset cache. | 115 // Reset cache. |
116 void Reset(); | 116 void Reset(); |
117 | 117 |
118 // Informs the renderers of the current password sync state for use in | 118 // Informs the renderer of the current password sync state for use in |
119 // password generation. This is a separate function to aid with testing. | 119 // password generation. This is a separate function to aid with testing. |
Ilya Sherman
2012/04/24 00:46:54
nit: Should the reference to "sync" in this commen
Garrett Casto
2012/04/24 18:49:56
Done.
| |
120 virtual void SendPasswordSyncStateToRenderer(content::RenderViewHost* host, | 120 virtual void SendPasswordGenerationStateToRenderer( |
121 bool enabled); | 121 content::RenderViewHost* host, |
122 bool enabled); | |
122 | 123 |
123 // Logs quality metrics for the |submitted_form| and uploads the form data | 124 // Logs quality metrics for the |submitted_form| and uploads the form data |
124 // to the crowdsourcing server, if appropriate. | 125 // to the crowdsourcing server, if appropriate. |
125 virtual void UploadFormDataAsyncCallback( | 126 virtual void UploadFormDataAsyncCallback( |
126 const FormStructure* submitted_form, | 127 const FormStructure* submitted_form, |
127 const base::TimeTicks& load_time, | 128 const base::TimeTicks& load_time, |
128 const base::TimeTicks& interaction_time, | 129 const base::TimeTicks& interaction_time, |
129 const base::TimeTicks& submission_time); | 130 const base::TimeTicks& submission_time); |
130 | 131 |
131 // Maps GUIDs to and from IDs that are used to identify profiles and credit | 132 // Maps GUIDs to and from IDs that are used to identify profiles and credit |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 // AutofillDownloadManager::Observer: | 166 // AutofillDownloadManager::Observer: |
166 virtual void OnLoadedServerPredictions( | 167 virtual void OnLoadedServerPredictions( |
167 const std::string& response_xml) OVERRIDE; | 168 const std::string& response_xml) OVERRIDE; |
168 | 169 |
169 // ProfileSyncServiceObserver: | 170 // ProfileSyncServiceObserver: |
170 virtual void OnStateChanged() OVERRIDE; | 171 virtual void OnStateChanged() OVERRIDE; |
171 | 172 |
172 // Register as an observer with the sync service. | 173 // Register as an observer with the sync service. |
173 void RegisterWithSyncService(); | 174 void RegisterWithSyncService(); |
174 | 175 |
175 // Determines what the current state of password sync is, and if it has | 176 // Determines what the current state of password generation is, and if it has |
176 // changed from password_sync_enabled_. If it has changed or if | 177 // changed from password_generation_enabled_. If it has changed or if |
Ilya Sherman
2012/04/24 00:46:54
nit: password_generation_enabled_ -> |password_gen
Garrett Casto
2012/04/24 18:49:56
Done.
| |
177 // |new_renderer| is true, it notifies the renderer of this change via | 178 // |new_renderer| is true, it notifies the renderer of this change via |
178 // SendPasswordSyncStateToRenderer. | 179 // SendPasswordGenerationStateToRenderer. |
179 void UpdatePasswordSyncState(content::RenderViewHost* host, | 180 void UpdatePasswordGenerationState(content::RenderViewHost* host, |
180 bool new_renderer); | 181 bool new_renderer); |
181 | 182 |
182 void OnFormsSeen(const std::vector<webkit::forms::FormData>& forms, | 183 void OnFormsSeen(const std::vector<webkit::forms::FormData>& forms, |
183 const base::TimeTicks& timestamp); | 184 const base::TimeTicks& timestamp); |
184 void OnTextFieldDidChange(const webkit::forms::FormData& form, | 185 void OnTextFieldDidChange(const webkit::forms::FormData& form, |
185 const webkit::forms::FormField& field, | 186 const webkit::forms::FormField& field, |
186 const base::TimeTicks& timestamp); | 187 const base::TimeTicks& timestamp); |
187 | 188 |
188 // The |bounding_box| is a window relative value. | 189 // The |bounding_box| is a window relative value. |
189 void OnQueryFormFieldAutofill(int query_id, | 190 void OnQueryFormFieldAutofill(int query_id, |
190 const webkit::forms::FormData& form, | 191 const webkit::forms::FormData& form, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 bool user_did_type_; | 330 bool user_did_type_; |
330 // Has the user autofilled a form on this page? | 331 // Has the user autofilled a form on this page? |
331 bool user_did_autofill_; | 332 bool user_did_autofill_; |
332 // Has the user edited a field that was previously autofilled? | 333 // Has the user edited a field that was previously autofilled? |
333 bool user_did_edit_autofilled_field_; | 334 bool user_did_edit_autofilled_field_; |
334 // When the page finished loading. | 335 // When the page finished loading. |
335 base::TimeTicks forms_loaded_timestamp_; | 336 base::TimeTicks forms_loaded_timestamp_; |
336 // When the user first interacted with a potentially fillable form on this | 337 // When the user first interacted with a potentially fillable form on this |
337 // page. | 338 // page. |
338 base::TimeTicks initial_interaction_timestamp_; | 339 base::TimeTicks initial_interaction_timestamp_; |
339 // If password sync is enabled. We cache this value so that we don't | 340 // If password generation is enabled. We cache this value so that we don't |
340 // spam the renderer with messages during startup when the sync state | 341 // spam the renderer with messages during startup when the sync state |
341 // is changing rapidly. | 342 // is changing rapidly. |
342 bool password_sync_enabled_; | 343 bool password_generation_enabled_; |
343 // The ProfileSyncService associated with this tab. This may be NULL in | 344 // The ProfileSyncService associated with this tab. This may be NULL in |
344 // testing. | 345 // testing. |
345 base::WeakPtr<ProfileSyncService> sync_service_; | 346 base::WeakPtr<ProfileSyncService> sync_service_; |
346 | 347 |
347 // Our copy of the form data. | 348 // Our copy of the form data. |
348 ScopedVector<FormStructure> form_structures_; | 349 ScopedVector<FormStructure> form_structures_; |
349 | 350 |
350 // GUID to ID mapping. We keep two maps to convert back and forth. | 351 // GUID to ID mapping. We keep two maps to convert back and forth. |
351 mutable std::map<GUIDPair, int> guid_id_map_; | 352 mutable std::map<GUIDPair, int> guid_id_map_; |
352 mutable std::map<int, GUIDPair> id_guid_map_; | 353 mutable std::map<int, GUIDPair> id_guid_map_; |
(...skipping 21 matching lines...) Expand all Loading... | |
374 TestTabContentsWithExternalDelegate); | 375 TestTabContentsWithExternalDelegate); |
375 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 376 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
376 UserHappinessFormLoadAndSubmission); | 377 UserHappinessFormLoadAndSubmission); |
377 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 378 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
378 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); | 379 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); |
379 | 380 |
380 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 381 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
381 }; | 382 }; |
382 | 383 |
383 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 384 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
OLD | NEW |