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 |
25 static ProfileKeyedService* Build(content::BrowserContext* profile); | 25 // BrowserContextKeyedService::SetTestingFactory(). |
| 26 static BrowserContextKeyedService* Build(content::BrowserContext* profile); |
26 }; | 27 }; |
27 | 28 |
28 #if !defined(OS_CHROMEOS) | 29 #if !defined(OS_CHROMEOS) |
29 | 30 |
30 // A signin manager that bypasses actual authentication routines with servers | 31 // A signin manager that bypasses actual authentication routines with servers |
31 // and accepts the credentials provided to StartSignIn. | 32 // and accepts the credentials provided to StartSignIn. |
32 class FakeSigninManager : public SigninManager { | 33 class FakeSigninManager : public SigninManager { |
33 public: | 34 public: |
34 explicit FakeSigninManager(Profile* profile); | 35 explicit FakeSigninManager(Profile* profile); |
35 virtual ~FakeSigninManager(); | 36 virtual ~FakeSigninManager(); |
(...skipping 10 matching lines...) Expand all Loading... |
46 const std::string& login_captcha) OVERRIDE; | 47 const std::string& login_captcha) OVERRIDE; |
47 | 48 |
48 virtual void StartSignInWithCredentials( | 49 virtual void StartSignInWithCredentials( |
49 const std::string& session_index, | 50 const std::string& session_index, |
50 const std::string& username, | 51 const std::string& username, |
51 const std::string& password, | 52 const std::string& password, |
52 const OAuthTokenFetchedCallback& oauth_fetched_callback) OVERRIDE; | 53 const OAuthTokenFetchedCallback& oauth_fetched_callback) OVERRIDE; |
53 | 54 |
54 virtual void CompletePendingSignin() OVERRIDE; | 55 virtual void CompletePendingSignin() OVERRIDE; |
55 | 56 |
56 // Helper function to be used with ProfileKeyedService::SetTestingFactory(). | 57 // Helper function to be used with |
57 static ProfileKeyedService* Build(content::BrowserContext* profile); | 58 // BrowserContextKeyedService::SetTestingFactory(). |
| 59 static BrowserContextKeyedService* Build(content::BrowserContext* profile); |
58 }; | 60 }; |
59 | 61 |
60 #endif // !defined (OS_CHROMEOS) | 62 #endif // !defined (OS_CHROMEOS) |
61 | 63 |
62 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ | 64 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ |
OLD | NEW |