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/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 : SigninManager(scoped_ptr<SigninManagerDelegate>( | 36 : SigninManager(scoped_ptr<SigninManagerDelegate>( |
37 new ChromeSigninManagerDelegate(profile))) { | 37 new ChromeSigninManagerDelegate(profile))) { |
38 } | 38 } |
39 | 39 |
40 FakeSigninManager::~FakeSigninManager() { | 40 FakeSigninManager::~FakeSigninManager() { |
41 } | 41 } |
42 | 42 |
43 void FakeSigninManager::InitTokenService() { | 43 void FakeSigninManager::InitTokenService() { |
44 } | 44 } |
45 | 45 |
46 void FakeSigninManager::StartSignIn(const std::string& username, | |
47 const std::string& password, | |
48 const std::string& login_token, | |
49 const std::string& login_captcha) { | |
50 SetAuthenticatedUsername(username); | |
51 } | |
52 | |
53 void FakeSigninManager::StartSignInWithCredentials( | 46 void FakeSigninManager::StartSignInWithCredentials( |
54 const std::string& session_index, | 47 const std::string& session_index, |
55 const std::string& username, | 48 const std::string& username, |
56 const std::string& password, | 49 const std::string& password, |
57 const OAuthTokenFetchedCallback& oauth_fetched_callback) { | 50 const OAuthTokenFetchedCallback& oauth_fetched_callback) { |
58 set_auth_in_progress(username); | 51 set_auth_in_progress(username); |
59 if (!oauth_fetched_callback.is_null()) | 52 if (!oauth_fetched_callback.is_null()) |
60 oauth_fetched_callback.Run("fake_oauth_token"); | 53 oauth_fetched_callback.Run("fake_oauth_token"); |
61 } | 54 } |
62 | 55 |
(...skipping 13 matching lines...) Expand all Loading... |
76 content::NotificationService::NoDetails()); | 69 content::NotificationService::NoDetails()); |
77 } | 70 } |
78 | 71 |
79 // static | 72 // static |
80 BrowserContextKeyedService* FakeSigninManager::Build( | 73 BrowserContextKeyedService* FakeSigninManager::Build( |
81 content::BrowserContext* profile) { | 74 content::BrowserContext* profile) { |
82 return new FakeSigninManager(static_cast<Profile*>(profile)); | 75 return new FakeSigninManager(static_cast<Profile*>(profile)); |
83 } | 76 } |
84 | 77 |
85 #endif // !defined (OS_CHROMEOS) | 78 #endif // !defined (OS_CHROMEOS) |
OLD | NEW |