Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: components/autofill/core/browser/form_structure.h

Issue 2800853004: UKM that threads together multiple form interaction events. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/callback.h" 15 #include "base/callback.h"
16 #include "base/gtest_prod_util.h" 16 #include "base/gtest_prod_util.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
19 #include "base/strings/string_piece.h" 19 #include "base/strings/string_piece.h"
20 #include "components/autofill/core/browser/autofill_field.h" 20 #include "components/autofill/core/browser/autofill_field.h"
21 #include "components/autofill/core/browser/autofill_metrics.h"
21 #include "components/autofill/core/browser/autofill_type.h" 22 #include "components/autofill/core/browser/autofill_type.h"
22 #include "components/autofill/core/browser/field_types.h" 23 #include "components/autofill/core/browser/field_types.h"
23 #include "components/autofill/core/browser/proto/server.pb.h" 24 #include "components/autofill/core/browser/proto/server.pb.h"
24 #include "url/gurl.h" 25 #include "url/gurl.h"
25 26
26 enum UploadRequired { 27 enum UploadRequired {
27 UPLOAD_NOT_REQUIRED, 28 UPLOAD_NOT_REQUIRED,
28 UPLOAD_REQUIRED, 29 UPLOAD_REQUIRED,
29 USE_UPLOAD_RATES 30 USE_UPLOAD_RATES
30 }; 31 };
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const bool apply_is_autofilled); 126 const bool apply_is_autofilled);
126 127
127 // Logs quality metrics for |this|, which should be a user-submitted form. 128 // Logs quality metrics for |this|, which should be a user-submitted form.
128 // This method should only be called after the possible field types have been 129 // This method should only be called after the possible field types have been
129 // set for each field. |interaction_time| should be a timestamp corresponding 130 // set for each field. |interaction_time| should be a timestamp corresponding
130 // to the user's first interaction with the form. |submission_time| should be 131 // to the user's first interaction with the form. |submission_time| should be
131 // a timestamp corresponding to the form's submission. |observed_submission| 132 // a timestamp corresponding to the form's submission. |observed_submission|
132 // indicates whether this method is called as a result of observing a 133 // indicates whether this method is called as a result of observing a
133 // submission event (otherwise, it may be that an upload was triggered after 134 // submission event (otherwise, it may be that an upload was triggered after
134 // a form was unfocused or a navigation occurred). 135 // a form was unfocused or a navigation occurred).
135 void LogQualityMetrics(const base::TimeTicks& load_time, 136 AutofillMetrics::AutofillFormSubmittedState LogQualityMetrics(
136 const base::TimeTicks& interaction_time, 137 const base::TimeTicks& load_time,
137 const base::TimeTicks& submission_time, 138 const base::TimeTicks& interaction_time,
138 rappor::RapporServiceImpl* rappor_service, 139 const base::TimeTicks& submission_time,
139 bool did_show_suggestions, 140 rappor::RapporServiceImpl* rappor_service,
140 bool observed_submission) const; 141 bool did_show_suggestions,
142 bool observed_submission) const;
141 143
142 // Log the quality of the heuristics and server predictions for this form 144 // Log the quality of the heuristics and server predictions for this form
143 // structure, if autocomplete attributes are present on the fields (they are 145 // structure, if autocomplete attributes are present on the fields (they are
144 // used as golden truths). 146 // used as golden truths).
145 void LogQualityMetricsBasedOnAutocomplete() const; 147 void LogQualityMetricsBasedOnAutocomplete() const;
146 148
147 // Classifies each field in |fields_| based upon its |autocomplete| attribute, 149 // Classifies each field in |fields_| based upon its |autocomplete| attribute,
148 // if the attribute is available. The association is stored into the field's 150 // if the attribute is available. The association is stored into the field's
149 // |heuristic_type|. 151 // |heuristic_type|.
150 // Fills |has_author_specified_types_| with |true| if the attribute is 152 // Fills |has_author_specified_types_| with |true| if the attribute is
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 // The unique signature for this form, composed of the target url domain, 330 // The unique signature for this form, composed of the target url domain,
329 // the form name, and the form field names in a 64-bit hash. 331 // the form name, and the form field names in a 64-bit hash.
330 FormSignature form_signature_; 332 FormSignature form_signature_;
331 333
332 DISALLOW_COPY_AND_ASSIGN(FormStructure); 334 DISALLOW_COPY_AND_ASSIGN(FormStructure);
333 }; 335 };
334 336
335 } // namespace autofill 337 } // namespace autofill
336 338
337 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ 339 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698