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

Side by Side Diff: chrome/browser/autofill/autofill_manager.h

Issue 7747009: Add metrics to track Autofill "user happiness" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 virtual const GUIDPair IDToGUID(int id); 108 virtual const GUIDPair IDToGUID(int id);
109 109
110 // Methods for packing and unpacking credit card and profile IDs for sending 110 // Methods for packing and unpacking credit card and profile IDs for sending
111 // and receiving to and from the renderer process. 111 // and receiving to and from the renderer process.
112 int PackGUIDs(const GUIDPair& cc_guid, const GUIDPair& profile_guid); 112 int PackGUIDs(const GUIDPair& cc_guid, const GUIDPair& profile_guid);
113 void UnpackGUIDs(int id, GUIDPair* cc_guid, GUIDPair* profile_guid); 113 void UnpackGUIDs(int id, GUIDPair* cc_guid, GUIDPair* profile_guid);
114 114
115 private: 115 private:
116 void OnFormSubmitted(const webkit_glue::FormData& form); 116 void OnFormSubmitted(const webkit_glue::FormData& form);
117 void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms); 117 void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms);
118 void OnTextFieldDidChange(const webkit_glue::FormData& form,
119 const webkit_glue::FormField& field);
118 void OnQueryFormFieldAutofill(int query_id, 120 void OnQueryFormFieldAutofill(int query_id,
119 const webkit_glue::FormData& form, 121 const webkit_glue::FormData& form,
120 const webkit_glue::FormField& field); 122 const webkit_glue::FormField& field);
121 void OnFillAutofillFormData(int query_id, 123 void OnFillAutofillFormData(int query_id,
122 const webkit_glue::FormData& form, 124 const webkit_glue::FormData& form,
123 const webkit_glue::FormField& field, 125 const webkit_glue::FormField& field,
124 int unique_id); 126 int unique_id);
125 void OnShowAutofillDialog(); 127 void OnShowAutofillDialog();
128 void OnDidPreviewAutofillFormData();
126 void OnDidFillAutofillFormData(); 129 void OnDidFillAutofillFormData();
127 void OnDidShowAutofillSuggestions(); 130 void OnDidShowAutofillSuggestions(bool is_new_popup);
128 131
129 // Fills |host| with the RenderViewHost for this tab. 132 // Fills |host| with the RenderViewHost for this tab.
130 // Returns false if Autofill is disabled or if the host is unavailable. 133 // Returns false if Autofill is disabled or if the host is unavailable.
131 bool GetHost(const std::vector<AutofillProfile*>& profiles, 134 bool GetHost(const std::vector<AutofillProfile*>& profiles,
132 const std::vector<CreditCard*>& credit_cards, 135 const std::vector<CreditCard*>& credit_cards,
133 RenderViewHost** host) const WARN_UNUSED_RESULT; 136 RenderViewHost** host) const WARN_UNUSED_RESULT;
134 137
135 // Fills |form_structure| cached element corresponding to |form|. 138 // Fills |form_structure| cached element corresponding to |form|.
136 // Returns false if the cached element was not found. 139 // Returns false if the cached element was not found.
137 bool FindCachedForm(const webkit_glue::FormData& form, 140 bool FindCachedForm(const webkit_glue::FormData& form,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 AutofillDownloadManager download_manager_; 212 AutofillDownloadManager download_manager_;
210 213
211 // Should be set to true in AutofillManagerTest and other tests, false in 214 // Should be set to true in AutofillManagerTest and other tests, false in
212 // AutofillDownloadManagerTest and in non-test environment. Is false by 215 // AutofillDownloadManagerTest and in non-test environment. Is false by
213 // default for the public constructor, and true by default for the test-only 216 // default for the public constructor, and true by default for the test-only
214 // constructors. 217 // constructors.
215 bool disable_download_manager_requests_; 218 bool disable_download_manager_requests_;
216 219
217 // For logging UMA metrics. Overridden by metrics tests. 220 // For logging UMA metrics. Overridden by metrics tests.
218 scoped_ptr<const AutofillMetrics> metric_logger_; 221 scoped_ptr<const AutofillMetrics> metric_logger_;
219
220 // Have we logged whether Autofill is enabled for this page load? 222 // Have we logged whether Autofill is enabled for this page load?
221 bool has_logged_autofill_enabled_; 223 bool has_logged_autofill_enabled_;
222
223 // Have we logged an address suggestions count metric for this page? 224 // Have we logged an address suggestions count metric for this page?
224 bool has_logged_address_suggestions_count_; 225 bool has_logged_address_suggestions_count_;
226 // Have we shown Autofill suggestions at least once?
227 bool did_show_suggestions_;
228 // Has the user manually edited at least one form field among the autofillable
229 // ones?
230 bool user_did_type_;
231 // Has the user autofilled a form on this page?
232 bool user_did_autofill_;
233 // Has the user edited a field that was previously autofilled?
234 bool user_did_edit_autofilled_field_;
225 235
226 // Our copy of the form data. 236 // Our copy of the form data.
227 ScopedVector<FormStructure> form_structures_; 237 ScopedVector<FormStructure> form_structures_;
228 238
229 // GUID to ID mapping. We keep two maps to convert back and forth. 239 // GUID to ID mapping. We keep two maps to convert back and forth.
230 std::map<GUIDPair, int> guid_id_map_; 240 std::map<GUIDPair, int> guid_id_map_;
231 std::map<int, GUIDPair> id_guid_map_; 241 std::map<int, GUIDPair> id_guid_map_;
232 242
233 friend class AutofillManagerTest; 243 friend class AutofillManagerTest;
234 friend class FormStructureBrowserTest; 244 friend class FormStructureBrowserTest;
(...skipping 26 matching lines...) Expand all
261 NoQualityMetricsForNonAutofillableForms); 271 NoQualityMetricsForNonAutofillableForms);
262 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetrics); 272 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetrics);
263 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsForFailure); 273 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsForFailure);
264 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsWithExperimentId); 274 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsWithExperimentId);
265 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, SaneMetricsWithCacheMismatch); 275 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, SaneMetricsWithCacheMismatch);
266 276
267 DISALLOW_COPY_AND_ASSIGN(AutofillManager); 277 DISALLOW_COPY_AND_ASSIGN(AutofillManager);
268 }; 278 };
269 279
270 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ 280 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager.cc » ('j') | chrome/browser/autofill/autofill_metrics.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698