1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_METRICS_H_
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_METRICS_H_
8 namespace signin_metrics {
10 // Enum for the ways in which primary account detection is done.
11 enum DifferentPrimaryAccounts {
12 // token and cookie had same primary accounts.
14 // Deprecated. Indicates different primary accounts.
15 UNUSED_ACCOUNTS_DIFFERENT,
16 // No GAIA cookie present, so the primaries are considered different.
18 // There was at least one cookie and one token, and the primaries differed.
19 COOKIE_AND_TOKEN_PRIMARIES_DIFFERENT,
20 NUM_DIFFERENT_PRIMARY_ACCOUNT_METRICS,
23 // Track all the ways a profile can become signed out as a histogram.
25 // The value used within unit tests
27 // The preference or policy controlling if signin is valid has changed.
28 SIGNOUT_PREF_CHANGED = 0,
29 // The valid pattern for signing in to the Google service changed.
30 GOOGLE_SERVICE_NAME_PATTERN_CHANGED,
31 // The preference or policy controlling if signin is valid changed during
32 // the signin process.
33 SIGNIN_PREF_CHANGED_DURING_SIGNIN,
34 // User clicked to signout from the settings page.
35 USER_CLICKED_SIGNOUT_SETTINGS,
36 // The signin process was aborted, but signin had succeeded, so signout. This
37 // may be due to a server response, policy definition or user action.
39 // The sync server caused the profile to be signed out.
40 SERVER_FORCED_DISABLE,
41 // The credentials are being transfered to a new profile, so the old one is
45 // Keep this as the last enum.
46 NUM_PROFILE_SIGNOUT_METRICS,
49 // Log to UMA histograms and UserCounts stats about a single execution of the
51 // |total_number_accounts| - How many accounts are in the browser for this
53 // |count_added_to_cookie_jar| - How many accounts were in the browser but not
55 // |count_added_to_token| - How may accounts were in the cookie jar but not in
57 // |primary_accounts_same| - False if the primary account for the cookie jar
58 // and the token service were different; else true.
59 // |is_first_reconcile| - True if these stats are from the first execution of
60 // the AccountReconcilor.
61 // |pre_count_gaia_cookies| - How many GAIA cookies were present before
62 // the AccountReconcilor began modifying the state.
63 void LogSigninAccountReconciliation(int total_number_accounts,
64 int count_added_to_cookie_jar,
65 int count_added_to_token,
66 bool primary_accounts_same,
67 bool is_first_reconcile,
68 int pre_count_gaia_cookies);
70 // Track a successful signin.
71 void LogSigninAddAccount();
73 // Track a profile signout.
74 void LogSignout(ProfileSignout metric);
76 } // namespace signin_metrics
78 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_METRICS_H_