| 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 COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 namespace base { | 32 namespace base { |
| 33 class TimeTicks; | 33 class TimeTicks; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace rappor { | 36 namespace rappor { |
| 37 class RapporServiceImpl; | 37 class RapporServiceImpl; |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace ukm { |
| 41 class UkmService; |
| 42 } |
| 43 |
| 40 namespace autofill { | 44 namespace autofill { |
| 41 | 45 |
| 42 struct FormData; | 46 struct FormData; |
| 43 struct FormDataPredictions; | 47 struct FormDataPredictions; |
| 44 | 48 |
| 45 // FormStructure stores a single HTML form together with the values entered | 49 // FormStructure stores a single HTML form together with the values entered |
| 46 // in the fields along with additional information needed by Autofill. | 50 // in the fields along with additional information needed by Autofill. |
| 47 class FormStructure { | 51 class FormStructure { |
| 48 public: | 52 public: |
| 49 explicit FormStructure(const FormData& form); | 53 explicit FormStructure(const FormData& form); |
| 50 virtual ~FormStructure(); | 54 virtual ~FormStructure(); |
| 51 | 55 |
| 52 // Runs several heuristics against the form fields to determine their possible | 56 // Runs several heuristics against the form fields to determine their possible |
| 53 // types. | 57 // types. If |ukm_service| is specified, logs UKM for the form structure |
| 54 void DetermineHeuristicTypes(); | 58 // corresponding to |source_url_|. |
| 59 void DetermineHeuristicTypes(ukm::UkmService* ukm_service); |
| 55 | 60 |
| 56 // Encodes the proto |upload| request from this FormStructure. | 61 // Encodes the proto |upload| request from this FormStructure. |
| 57 // In some cases, a |login_form_signature| is included as part of the upload. | 62 // In some cases, a |login_form_signature| is included as part of the upload. |
| 58 // This field is empty when sending upload requests for non-login forms. | 63 // This field is empty when sending upload requests for non-login forms. |
| 59 bool EncodeUploadRequest(const ServerFieldTypeSet& available_field_types, | 64 bool EncodeUploadRequest(const ServerFieldTypeSet& available_field_types, |
| 60 bool form_was_autofilled, | 65 bool form_was_autofilled, |
| 61 const std::string& login_form_signature, | 66 const std::string& login_form_signature, |
| 62 bool observed_submission, | 67 bool observed_submission, |
| 63 autofill::AutofillUploadContents* upload) const; | 68 autofill::AutofillUploadContents* upload) const; |
| 64 | 69 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // The unique signature for this form, composed of the target url domain, | 328 // The unique signature for this form, composed of the target url domain, |
| 324 // the form name, and the form field names in a 64-bit hash. | 329 // the form name, and the form field names in a 64-bit hash. |
| 325 FormSignature form_signature_; | 330 FormSignature form_signature_; |
| 326 | 331 |
| 327 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 332 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
| 328 }; | 333 }; |
| 329 | 334 |
| 330 } // namespace autofill | 335 } // namespace autofill |
| 331 | 336 |
| 332 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 337 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| OLD | NEW |