| 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 #ifndef CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ | 6 #define CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/signin/signin_manager.h" | 11 #include "chrome/browser/signin/signin_manager.h" |
| 12 | 12 |
| 13 class Profile; | 13 class Profile; |
| 14 class ProfileKeyedService; | 14 class BrowserContextKeyedService; |
| 15 | 15 |
| 16 // Overrides InitTokenService to do-nothing in tests. | 16 // Overrides InitTokenService to do-nothing in tests. |
| 17 class FakeSigninManagerBase : public SigninManagerBase { | 17 class FakeSigninManagerBase : public SigninManagerBase { |
| 18 public: | 18 public: |
| 19 explicit FakeSigninManagerBase(); | 19 explicit FakeSigninManagerBase(); |
| 20 virtual ~FakeSigninManagerBase(); | 20 virtual ~FakeSigninManagerBase(); |
| 21 | 21 |
| 22 virtual void InitTokenService() OVERRIDE; | 22 virtual void InitTokenService() OVERRIDE; |
| 23 | 23 |
| 24 // Helper function to be used with ProfileKeyedService::SetTestingFactory(). | 24 // Helper function to be used with BrowserContextKeyedService::SetTestingFacto
ry(). |
| 25 static ProfileKeyedService* Build(content::BrowserContext* profile); | 25 static BrowserContextKeyedService* Build(content::BrowserContext* profile); |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 #if !defined(OS_CHROMEOS) | 28 #if !defined(OS_CHROMEOS) |
| 29 | 29 |
| 30 // A signin manager that bypasses actual authentication routines with servers | 30 // A signin manager that bypasses actual authentication routines with servers |
| 31 // and accepts the credentials provided to StartSignIn. | 31 // and accepts the credentials provided to StartSignIn. |
| 32 class FakeSigninManager : public SigninManager { | 32 class FakeSigninManager : public SigninManager { |
| 33 public: | 33 public: |
| 34 explicit FakeSigninManager(Profile* profile); | 34 explicit FakeSigninManager(Profile* profile); |
| 35 virtual ~FakeSigninManager(); | 35 virtual ~FakeSigninManager(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 46 const std::string& login_captcha) OVERRIDE; | 46 const std::string& login_captcha) OVERRIDE; |
| 47 | 47 |
| 48 virtual void StartSignInWithCredentials( | 48 virtual void StartSignInWithCredentials( |
| 49 const std::string& session_index, | 49 const std::string& session_index, |
| 50 const std::string& username, | 50 const std::string& username, |
| 51 const std::string& password, | 51 const std::string& password, |
| 52 const OAuthTokenFetchedCallback& oauth_fetched_callback) OVERRIDE; | 52 const OAuthTokenFetchedCallback& oauth_fetched_callback) OVERRIDE; |
| 53 | 53 |
| 54 virtual void CompletePendingSignin() OVERRIDE; | 54 virtual void CompletePendingSignin() OVERRIDE; |
| 55 | 55 |
| 56 // Helper function to be used with ProfileKeyedService::SetTestingFactory(). | 56 // Helper function to be used with BrowserContextKeyedService::SetTestingFacto
ry(). |
| 57 static ProfileKeyedService* Build(content::BrowserContext* profile); | 57 static BrowserContextKeyedService* Build(content::BrowserContext* profile); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 #endif // !defined (OS_CHROMEOS) | 60 #endif // !defined (OS_CHROMEOS) |
| 61 | 61 |
| 62 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ | 62 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ |
| OLD | NEW |