| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Returns true if we should query the crowdsourcing server to determine this | 109 // Returns true if we should query the crowdsourcing server to determine this |
| 110 // form's field types. If the form includes author-specified types, this will | 110 // form's field types. If the form includes author-specified types, this will |
| 111 // return false unless there are password fields in the form. If there are no | 111 // return false unless there are password fields in the form. If there are no |
| 112 // password fields the assumption is that the author has expressed their | 112 // password fields the assumption is that the author has expressed their |
| 113 // intent and crowdsourced data should not be used to override this. Password | 113 // intent and crowdsourced data should not be used to override this. Password |
| 114 // fields are different because there is no way to specify password generation | 114 // fields are different because there is no way to specify password generation |
| 115 // directly. | 115 // directly. |
| 116 bool ShouldBeCrowdsourced() const; | 116 bool ShouldBeCrowdsourced() const; |
| 117 | 117 |
| 118 // Sets the field types to be those set for |cached_form|. | 118 // Sets the field types to be those set for |cached_form|. |
| 119 void UpdateFromCache(const FormStructure& cached_form); | 119 void UpdateFromCache(const FormStructure& cached_form, |
| 120 const bool apply_is_autofilled); |
| 120 | 121 |
| 121 // Logs quality metrics for |this|, which should be a user-submitted form. | 122 // Logs quality metrics for |this|, which should be a user-submitted form. |
| 122 // This method should only be called after the possible field types have been | 123 // This method should only be called after the possible field types have been |
| 123 // set for each field. |interaction_time| should be a timestamp corresponding | 124 // set for each field. |interaction_time| should be a timestamp corresponding |
| 124 // to the user's first interaction with the form. |submission_time| should be | 125 // to the user's first interaction with the form. |submission_time| should be |
| 125 // a timestamp corresponding to the form's submission. |observed_submission| | 126 // a timestamp corresponding to the form's submission. |observed_submission| |
| 126 // indicates whether this method is called as a result of observing a | 127 // indicates whether this method is called as a result of observing a |
| 127 // submission event (otherwise, it may be that an upload was triggered after | 128 // submission event (otherwise, it may be that an upload was triggered after |
| 128 // a form was unfocused or a navigation occurred). | 129 // a form was unfocused or a navigation occurred). |
| 129 void LogQualityMetrics(const base::TimeTicks& load_time, | 130 void LogQualityMetrics(const base::TimeTicks& load_time, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // The unique signature for this form, composed of the target url domain, | 313 // The unique signature for this form, composed of the target url domain, |
| 313 // the form name, and the form field names in a 64-bit hash. | 314 // the form name, and the form field names in a 64-bit hash. |
| 314 FormSignature form_signature_; | 315 FormSignature form_signature_; |
| 315 | 316 |
| 316 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 317 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
| 317 }; | 318 }; |
| 318 | 319 |
| 319 } // namespace autofill | 320 } // namespace autofill |
| 320 | 321 |
| 321 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 322 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| OLD | NEW |