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/signin_manager_fake.h" | 5 #include "chrome/browser/signin/signin_manager_fake.h" |
6 | 6 |
7 FakeSigninManager::FakeSigninManager() {} | 7 #include "chrome/common/chrome_notification_types.h" |
| 8 #include "content/public/browser/notification_service.h" |
| 9 |
| 10 FakeSigninManager::FakeSigninManager(Profile* profile) { |
| 11 profile_ = profile; |
| 12 } |
8 | 13 |
9 FakeSigninManager::~FakeSigninManager() {} | 14 FakeSigninManager::~FakeSigninManager() {} |
10 | 15 |
11 void FakeSigninManager::StartSignIn(const std::string& username, | 16 void FakeSigninManager::StartSignIn(const std::string& username, |
12 const std::string& password, | 17 const std::string& password, |
13 const std::string& login_token, | 18 const std::string& login_token, |
14 const std::string& login_captcha) { | 19 const std::string& login_captcha) { |
15 SetAuthenticatedUsername(username); | 20 SetAuthenticatedUsername(username); |
16 } | 21 } |
17 | 22 |
18 void FakeSigninManager::StartSignInWithCredentials( | 23 void FakeSigninManager::StartSignInWithCredentials( |
19 const std::string& session_index, | 24 const std::string& session_index, |
20 const std::string& username, | 25 const std::string& username, |
21 const std::string& password) { | 26 const std::string& password) { |
22 SetAuthenticatedUsername(username); | 27 SetAuthenticatedUsername(username); |
23 } | 28 } |
24 | 29 |
25 void FakeSigninManager::StartSignInWithOAuth(const std::string& username, | 30 void FakeSigninManager::StartSignInWithOAuth(const std::string& username, |
26 const std::string& password) { | 31 const std::string& password) { |
27 SetAuthenticatedUsername(username); | 32 SetAuthenticatedUsername(username); |
28 } | 33 } |
29 | 34 |
30 void FakeSigninManager::SignOut() { | 35 void FakeSigninManager::SignOut() { |
31 authenticated_username_.clear(); | 36 authenticated_username_.clear(); |
| 37 content::NotificationService::current()->Notify( |
| 38 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, |
| 39 content::Source<Profile>(profile_), |
| 40 content::NotificationService::NoDetails()); |
32 } | 41 } |
33 | 42 |
34 // static | 43 // static |
35 ProfileKeyedService* FakeSigninManager::Build(Profile* profile) { | 44 ProfileKeyedService* FakeSigninManager::Build(Profile* profile) { |
36 return new FakeSigninManager(); | 45 return new FakeSigninManager(profile); |
37 } | 46 } |
OLD | NEW |