Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 std::vector<string16>* labels, | 187 std::vector<string16>* labels, |
| 188 std::vector<string16>* icons, | 188 std::vector<string16>* icons, |
| 189 std::vector<int>* unique_ids) const; | 189 std::vector<int>* unique_ids) const; |
| 190 | 190 |
| 191 // Set |field|'s value based on |type| and contents of the |credit_card|. | 191 // Set |field|'s value based on |type| and contents of the |credit_card|. |
| 192 void FillCreditCardFormField(const CreditCard& credit_card, | 192 void FillCreditCardFormField(const CreditCard& credit_card, |
| 193 AutofillFieldType type, | 193 AutofillFieldType type, |
| 194 webkit_glue::FormField* field); | 194 webkit_glue::FormField* field); |
| 195 | 195 |
| 196 // Set |field|'s value based on |cached_field|'s type and contents of the | 196 // Set |field|'s value based on |cached_field|'s type and contents of the |
| 197 // |profile|. The |variant| parameter specifies which value in a multi-valued | 197 // |profile|. The |variant| parameter specifies which value in a multi-valued |
| 198 // profile. | 198 // profile. |
| 199 void FillFormField(const AutofillProfile& profile, | 199 void FillFormField(const AutofillProfile& profile, |
| 200 const AutofillField& cached_field, | 200 const AutofillField& cached_field, |
| 201 size_t variant, | 201 size_t variant, |
| 202 webkit_glue::FormField* field); | 202 webkit_glue::FormField* field); |
| 203 | 203 |
| 204 // Set |field|'s value for phone/fax number based on contents of the | 204 // Set |field|'s value for phone number based on contents of the |profile|. |
| 205 // |profile|. The |cached_field| specifies the type of the phone and whether | 205 // The |cached_field| specifies the type of the phone and whether this is a |
| 206 // this is a phone prefix or suffix. The |variant| parameter specifies which | 206 // phone prefix or suffix. The |variant| parameter specifies which value in a |
| 207 // value in a multi-valued profile. | 207 // multi-valued profile. |
| 208 void FillPhoneNumberField(const AutofillProfile& profile, | 208 void FillPhoneNumberField(const AutofillProfile& profile, |
| 209 const AutofillField& cached_field, | 209 const AutofillField& cached_field, |
| 210 size_t variant, | 210 size_t variant, |
| 211 webkit_glue::FormField* field); | 211 webkit_glue::FormField* field); |
| 212 | 212 |
| 213 // Parses the forms using heuristic matching and querying the Autofill server. | 213 // Parses the forms using heuristic matching and querying the Autofill server. |
| 214 void ParseForms(const std::vector<webkit_glue::FormData>& forms); | 214 void ParseForms(const std::vector<webkit_glue::FormData>& forms); |
| 215 | 215 |
| 216 // Uses existing personal data to determine possible field types for the | 216 // Uses existing personal data to determine possible field types for the |
| 217 // |submitted_form|. | 217 // |submitted_form|. |
| 218 void DeterminePossibleFieldTypesForUpload(FormStructure* submitted_form); | 218 void DeterminePossibleFieldTypesForUpload(FormStructure* submitted_form); |
| 219 | 219 |
| 220 // If |initial_interaction_timestamp_| is unset or is set to a later time than | 220 // If |initial_interaction_timestamp_| is unset or is set to a later time than |
| 221 // |interaction_timestamp|, updates the cached timestamp. The latter check is | 221 // |interaction_timestamp|, updates the cached timestamp. The latter check is |
|
Ilya Sherman
2011/09/15 03:47:08
nit: Please preserve two spaces after a sentence c
James Hawkins
2011/09/16 03:23:28
Done.
I could swear we made the style rule of one
| |
| 222 // needed because IPC messages can arrive out of order. | 222 // needed because IPC messages can arrive out of order. |
| 223 void UpdateInitialInteractionTimestamp( | 223 void UpdateInitialInteractionTimestamp( |
| 224 const base::TimeTicks& interaction_timestamp); | 224 const base::TimeTicks& interaction_timestamp); |
| 225 | 225 |
| 226 // Send our current field type predictions to the renderer. | 226 // Send our current field type predictions to the renderer. This is a no-op if |
| 227 // This is a no-op if the appropriate command-line flag is not set. | 227 // the appropriate command-line flag is not set. |
| 228 void SendAutofillTypePredictions( | 228 void SendAutofillTypePredictions( |
| 229 const std::vector<FormStructure*>& forms) const; | 229 const std::vector<FormStructure*>& forms) const; |
| 230 | 230 |
| 231 // The owning TabContentsWrapper. | 231 // The owning TabContentsWrapper. |
| 232 TabContentsWrapper* tab_contents_wrapper_; | 232 TabContentsWrapper* tab_contents_wrapper_; |
| 233 | 233 |
| 234 // The personal data manager, used to save and load personal data to/from the | 234 // The personal data manager, used to save and load personal data to/from the |
| 235 // web database. This is overridden by the AutofillManagerTest. | 235 // web database. This is overridden by the AutofillManagerTest. |
| 236 // Weak reference. | 236 // Weak reference. |
| 237 // May be NULL. NULL indicates OTR. | 237 // May be NULL. NULL indicates OTR. |
| 238 PersonalDataManager* personal_data_; | 238 PersonalDataManager* personal_data_; |
| 239 | 239 |
| 240 std::list<std::string> autofilled_form_signatures_; | 240 std::list<std::string> autofilled_form_signatures_; |
| 241 // Handles queries and uploads to Autofill servers. | 241 // Handles queries and uploads to Autofill servers. |
| 242 AutofillDownloadManager download_manager_; | 242 AutofillDownloadManager download_manager_; |
| 243 | 243 |
| 244 // Should be set to true in AutofillManagerTest and other tests, false in | 244 // Should be set to true in AutofillManagerTest and other tests, false in |
| 245 // AutofillDownloadManagerTest and in non-test environment. Is false by | 245 // AutofillDownloadManagerTest and in non-test environment. Is false by |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, SaneMetricsWithCacheMismatch); | 310 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, SaneMetricsWithCacheMismatch); |
| 311 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 311 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
| 312 UserHappinessFormLoadAndSubmission); | 312 UserHappinessFormLoadAndSubmission); |
| 313 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 313 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
| 314 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); | 314 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); |
| 315 | 315 |
| 316 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 316 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
| 317 }; | 317 }; |
| 318 | 318 |
| 319 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 319 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| OLD | NEW |