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

Side by Side Diff: chrome/browser/signin/fake_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/signin/fake_signin_manager.h" 5 #include "chrome/browser/signin/fake_signin_manager.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" 10 #include "chrome/browser/signin/chrome_signin_client_factory.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 const std::string& password) { 88 const std::string& password) {
89 StartSignInWithRefreshToken( 89 StartSignInWithRefreshToken(
90 std::string(), username, password, OAuthTokenFetchedCallback()); 90 std::string(), username, password, OAuthTokenFetchedCallback());
91 CompletePendingSignin(); 91 CompletePendingSignin();
92 } 92 }
93 93
94 void FakeSigninManager::FailSignin(const GoogleServiceAuthError& error) { 94 void FakeSigninManager::FailSignin(const GoogleServiceAuthError& error) {
95 FOR_EACH_OBSERVER(Observer, observer_list_, GoogleSigninFailed(error)); 95 FOR_EACH_OBSERVER(Observer, observer_list_, GoogleSigninFailed(error));
96 } 96 }
97 97
98 void FakeSigninManager::SignOut() { 98 void FakeSigninManager::SignOut(
99 signin_metrics::ProfileSignout signout_source_metric) {
99 if (IsSignoutProhibited()) 100 if (IsSignoutProhibited())
100 return; 101 return;
101 set_auth_in_progress(std::string()); 102 set_auth_in_progress(std::string());
102 set_password(std::string()); 103 set_password(std::string());
103 const std::string username = authenticated_username_; 104 const std::string username = authenticated_username_;
104 authenticated_username_.clear(); 105 authenticated_username_.clear();
105 106
106 FOR_EACH_OBSERVER(SigninManagerBase::Observer, observer_list_, 107 FOR_EACH_OBSERVER(SigninManagerBase::Observer, observer_list_,
107 GoogleSignedOut(username)); 108 GoogleSignedOut(username));
108 } 109 }
109 110
110 #endif // !defined (OS_CHROMEOS) 111 #endif // !defined (OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/signin/fake_signin_manager.h ('k') | chrome/browser/signin/signin_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698