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 #include "chrome/browser/metrics/signin_status_metrics_provider_base.h"
7 #include "base/metrics/histogram.h"
9 SigninStatusMetricsProviderBase::SigninStatusMetricsProviderBase()
10 : signin_status_(UNKNOWN_SIGNIN_STATUS
) {
13 SigninStatusMetricsProviderBase::~SigninStatusMetricsProviderBase() {
16 void SigninStatusMetricsProviderBase::RecordSigninStatusHistogram(
17 SigninStatus signin_status
) {
18 UMA_HISTOGRAM_ENUMERATION(
19 "UMA.ProfileSignInStatus", signin_status
, SIGNIN_STATUS_MAX
);
22 void SigninStatusMetricsProviderBase::SetSigninStatus(SigninStatus new_status
) {
23 // The recorded sign-in status value can't be changed once it's recorded as
24 // error until the next UMA upload.
25 if (signin_status_
== ERROR_GETTING_SIGNIN_STATUS
)
27 signin_status_
= new_status
;
30 void SigninStatusMetricsProviderBase::ResetSigninStatus() {
31 signin_status_
= UNKNOWN_SIGNIN_STATUS
;