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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace base { | 33 namespace base { |
34 class TimeTicks; | 34 class TimeTicks; |
35 } | 35 } |
36 | 36 |
37 namespace rappor { | 37 namespace rappor { |
38 class RapporServiceImpl; | 38 class RapporServiceImpl; |
39 } | 39 } |
40 | 40 |
41 namespace ukm { | 41 namespace ukm { |
42 class UkmService; | 42 class UkmRecorder; |
43 } | 43 } |
44 | 44 |
45 namespace autofill { | 45 namespace autofill { |
46 | 46 |
47 struct FormData; | 47 struct FormData; |
48 struct FormDataPredictions; | 48 struct FormDataPredictions; |
49 | 49 |
50 // FormStructure stores a single HTML form together with the values entered | 50 // FormStructure stores a single HTML form together with the values entered |
51 // in the fields along with additional information needed by Autofill. | 51 // in the fields along with additional information needed by Autofill. |
52 class FormStructure { | 52 class FormStructure { |
53 public: | 53 public: |
54 explicit FormStructure(const FormData& form); | 54 explicit FormStructure(const FormData& form); |
55 virtual ~FormStructure(); | 55 virtual ~FormStructure(); |
56 | 56 |
57 // Runs several heuristics against the form fields to determine their possible | 57 // Runs several heuristics against the form fields to determine their possible |
58 // types. If |ukm_service| is specified, logs UKM for the form structure | 58 // types. If |ukm_recorder| is specified, logs UKM for the form structure |
59 // corresponding to |source_url_|. | 59 // corresponding to |source_url_|. |
60 void DetermineHeuristicTypes(ukm::UkmService* ukm_service); | 60 void DetermineHeuristicTypes(ukm::UkmRecorder* ukm_recorder); |
61 | 61 |
62 // Encodes the proto |upload| request from this FormStructure. | 62 // Encodes the proto |upload| request from this FormStructure. |
63 // In some cases, a |login_form_signature| is included as part of the upload. | 63 // In some cases, a |login_form_signature| is included as part of the upload. |
64 // This field is empty when sending upload requests for non-login forms. | 64 // This field is empty when sending upload requests for non-login forms. |
65 bool EncodeUploadRequest(const ServerFieldTypeSet& available_field_types, | 65 bool EncodeUploadRequest(const ServerFieldTypeSet& available_field_types, |
66 bool form_was_autofilled, | 66 bool form_was_autofilled, |
67 const std::string& login_form_signature, | 67 const std::string& login_form_signature, |
68 bool observed_submission, | 68 bool observed_submission, |
69 autofill::AutofillUploadContents* upload) const; | 69 autofill::AutofillUploadContents* upload) const; |
70 | 70 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 // The unique signature for this form, composed of the target url domain, | 342 // The unique signature for this form, composed of the target url domain, |
343 // the form name, and the form field names in a 64-bit hash. | 343 // the form name, and the form field names in a 64-bit hash. |
344 FormSignature form_signature_; | 344 FormSignature form_signature_; |
345 | 345 |
346 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 346 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
347 }; | 347 }; |
348 | 348 |
349 } // namespace autofill | 349 } // namespace autofill |
350 | 350 |
351 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 351 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
OLD | NEW |