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 CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
6 #define CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
8 #include "base/gtest_prod_util.h"
9 #include "chrome/browser/metrics/signin_status_metrics_provider_base.h"
11 // Record and report the browser sign-in status on ChromeOS during each UMA
12 // session. On ChromeOS, the browser can only be at unsigned-in status when
13 // browsing as a guest, or before the user logs in (i.e. the user sees a login
14 // window.) When user logs out, the browser process is terminated. Therefore,
15 // the browser's sign-in status during one UMA session can only be alway
16 // signed-in, or always unsigned-in, or changing from unsigned-in to signed-in.
17 class SigninStatusMetricsProviderChromeOS
18 : public SigninStatusMetricsProviderBase
{
20 SigninStatusMetricsProviderChromeOS();
21 ~SigninStatusMetricsProviderChromeOS() override
;
23 // SigninStatusMetricsProviderBase:
24 void ProvideGeneralMetrics(
25 metrics::ChromeUserMetricsExtension
* uma_proto
) override
;
28 FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderChromeOS
,
29 ComputeSigninStatusToUpload
);
31 // Sets the |signin_status_| purely based on if the user is currently logged
32 // in to a non-guest profile.
33 void SetCurrentSigninStatus();
35 // Compute the sign-in status to upload to UMA log given the recorded sign-in
36 // status and if user is logged in now.
37 SigninStatus
ComputeSigninStatusToUpload(SigninStatus recorded_status
,
40 DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProviderChromeOS
);
43 #endif // CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_