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

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

Issue 884843002: Recording in UMA when a user interacted with an address form or a credit card form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing isherman comments Created 5 years, 10 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_AUTOFILL_METRICS_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 USER_DID_AUTOFILL, 236 USER_DID_AUTOFILL,
237 // Same as above, but only logged once per page load. 237 // Same as above, but only logged once per page load.
238 USER_DID_AUTOFILL_ONCE, 238 USER_DID_AUTOFILL_ONCE,
239 // User edited a previously autofilled field. 239 // User edited a previously autofilled field.
240 USER_DID_EDIT_AUTOFILLED_FIELD, 240 USER_DID_EDIT_AUTOFILLED_FIELD,
241 // Same as above, but only logged once per page load. 241 // Same as above, but only logged once per page load.
242 USER_DID_EDIT_AUTOFILLED_FIELD_ONCE, 242 USER_DID_EDIT_AUTOFILLED_FIELD_ONCE,
243 NUM_USER_HAPPINESS_METRICS, 243 NUM_USER_HAPPINESS_METRICS,
244 }; 244 };
245 245
246 // Form Events for autofill.
247 // These events are triggered separetly for address and credit card forms.
248 enum AutofillFormEvent {
Evan Stade 2015/01/30 19:39:50 s/Event/Metric to match the other enums here (Even
Walter Cacau 2015/01/30 22:05:56 Keeping event for now as there seems to be a few o
249 // User interacted with a field of this kind of form. Logged only once per
250 // page load.
251 // TODO(waltercacau): All histograms here seem to start with 0,
252 // but the histogram code seems to expect a minimum of 1. Strangely,
253 // they seem to succeed all the assertions as long as there is more then
254 // one enum value.
Evan Stade 2015/01/30 19:39:50 Ilya^
255 INTERACTED_ONCE = 1,
256 NUM_AUTOFILL_FORM_EVENTS,
257 };
258
246 // For measuring the network request time of various Wallet API calls. See 259 // For measuring the network request time of various Wallet API calls. See
247 // WalletClient::RequestType. 260 // WalletClient::RequestType.
248 enum WalletApiCallMetric { 261 enum WalletApiCallMetric {
249 UNKNOWN_API_CALL, // Catch all. Should never be used. 262 UNKNOWN_API_CALL, // Catch all. Should never be used.
250 ACCEPT_LEGAL_DOCUMENTS, 263 ACCEPT_LEGAL_DOCUMENTS,
251 AUTHENTICATE_INSTRUMENT, 264 AUTHENTICATE_INSTRUMENT,
252 GET_FULL_WALLET, 265 GET_FULL_WALLET,
253 GET_WALLET_ITEMS, 266 GET_WALLET_ITEMS,
254 SAVE_TO_WALLET, 267 SAVE_TO_WALLET,
255 NUM_WALLET_API_CALLS 268 NUM_WALLET_API_CALLS
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // This should be called each time a new profile is launched. 421 // This should be called each time a new profile is launched.
409 static void LogIsAutofillEnabledAtStartup(bool enabled); 422 static void LogIsAutofillEnabledAtStartup(bool enabled);
410 423
411 // This should be called each time a new profile is launched. 424 // This should be called each time a new profile is launched.
412 static void LogStoredProfileCount(size_t num_profiles); 425 static void LogStoredProfileCount(size_t num_profiles);
413 426
414 // Log the number of Autofill suggestions presented to the user when filling a 427 // Log the number of Autofill suggestions presented to the user when filling a
415 // form. 428 // form.
416 static void LogAddressSuggestionsCount(size_t num_suggestions); 429 static void LogAddressSuggestionsCount(size_t num_suggestions);
417 430
431 // Utility to autofill form events in the relevant histograms depending on
432 // the presence of server and/or local data.
433 struct FormEventLogger {
Evan Stade 2015/01/30 19:39:50 this should be a class not a struct
Walter Cacau 2015/01/30 22:05:56 Done.
434 public:
435 FormEventLogger(
436 bool is_credit_card,
437 bool is_server_data_available,
438 bool is_local_data_available);
439 void Log(AutofillFormEvent event);
Evan Stade 2015/01/30 19:39:50 missing newline and doc
Walter Cacau 2015/01/30 22:05:56 Done.
440 private:
441 bool is_credit_card_;
442 bool is_server_data_available_;
443 bool is_local_data_available_;
444 };
Evan Stade 2015/01/30 19:39:50 missing newline
Walter Cacau 2015/01/30 22:05:56 Done.
418 private: 445 private:
419 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); 446 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics);
420 }; 447 };
421 448
422 } // namespace autofill 449 } // namespace autofill
423 450
424 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 451 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698