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

Unified Diff: components/signin/core/browser/signin_manager.cc

Issue 338993007: Track when and how a profile is signed out via UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SignOut() param in Android tests Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/signin/core/browser/signin_manager.h ('k') | components/signin/core/browser/signin_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/signin_manager.cc
diff --git a/components/signin/core/browser/signin_manager.cc b/components/signin/core/browser/signin_manager.cc
index 2a943cb11316f9c07a4184aa0e3f5a312f447a5c..144242615a9b0fc851069d0c4d50a095e4733b06 100644
--- a/components/signin/core/browser/signin_manager.cc
+++ b/components/signin/core/browser/signin_manager.cc
@@ -17,6 +17,7 @@
#include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_internals_util.h"
#include "components/signin/core/browser/signin_manager_cookie_helper.h"
+#include "components/signin/core/browser/signin_metrics.h"
#include "components/signin/core/common/signin_pref_names.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/gaia_urls.h"
@@ -171,9 +172,11 @@ void SigninManager::HandleAuthError(const GoogleServiceAuthError& error) {
FOR_EACH_OBSERVER(Observer, observer_list_, GoogleSigninFailed(error));
}
-void SigninManager::SignOut() {
+void SigninManager::SignOut(
+ signin_metrics::ProfileSignout signout_source_metric) {
DCHECK(IsInitialized());
+ signin_metrics::LogSignout(signout_source_metric);
if (GetAuthenticatedUsername().empty()) {
if (AuthInProgress()) {
// If the user is in the process of signing in, then treat a call to
@@ -235,7 +238,7 @@ void SigninManager::Initialize(PrefService* local_state) {
if ((!user.empty() && !IsAllowedUsername(user)) || !IsSigninAllowed()) {
// User is signed in, but the username is invalid - the administrator must
// have changed the policy since the last signin, so sign out the user.
- SignOut();
+ SignOut(signin_metrics::SIGNIN_PREF_CHANGED_DURING_SIGNIN);
}
InitTokenService();
@@ -257,7 +260,7 @@ void SigninManager::OnGoogleServicesUsernamePatternChanged() {
!IsAllowedUsername(GetAuthenticatedUsername())) {
// Signed in user is invalid according to the current policy so sign
// the user out.
- SignOut();
+ SignOut(signin_metrics::GOOGLE_SERVICE_NAME_PATTERN_CHANGED);
}
}
@@ -267,7 +270,7 @@ bool SigninManager::IsSigninAllowed() const {
void SigninManager::OnSigninAllowedPrefChanged() {
if (!IsSigninAllowed())
- SignOut();
+ SignOut(signin_metrics::SIGNOUT_PREF_CHANGED);
}
// static
« no previous file with comments | « components/signin/core/browser/signin_manager.h ('k') | components/signin/core/browser/signin_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698