OLD | NEW |
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 Loading... |
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) |
OLD | NEW |