Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: chrome/browser/signin/fake_signin_manager.h

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 ProfileKeyedService;
15 15
16 class FakeSigninManagerBase : public SigninManagerBase { 16 class FakeSigninManagerBase : public SigninManagerBase {
17 public: 17 public:
18 explicit FakeSigninManagerBase(Profile* profile); 18 explicit FakeSigninManagerBase(Profile* profile);
19 virtual ~FakeSigninManagerBase(); 19 virtual ~FakeSigninManagerBase();
20 20
21 virtual void SignOut() OVERRIDE; 21 virtual void SignOut() OVERRIDE;
22 22
23 // Helper function to be used with ProfileKeyedService::SetTestingFactory(). 23 // Helper function to be used with ProfileKeyedService::SetTestingFactory().
24 static ProfileKeyedService* Build(Profile* profile); 24 static ProfileKeyedService* Build(content::BrowserContext* profile);
25 }; 25 };
26 26
27 #if !defined(OS_CHROMEOS) 27 #if !defined(OS_CHROMEOS)
28 28
29 // A signin manager that bypasses actual authentication routines with servers 29 // A signin manager that bypasses actual authentication routines with servers
30 // and accepts the credentials provided to StartSignIn. 30 // and accepts the credentials provided to StartSignIn.
31 class FakeSigninManager : public SigninManager { 31 class FakeSigninManager : public SigninManager {
32 public: 32 public:
33 explicit FakeSigninManager(Profile* profile); 33 explicit FakeSigninManager(Profile* profile);
34 virtual ~FakeSigninManager(); 34 virtual ~FakeSigninManager();
35 35
36 void set_auth_in_progress(const std::string& username) { 36 void set_auth_in_progress(const std::string& username) {
37 possibly_invalid_username_ = username; 37 possibly_invalid_username_ = username;
38 } 38 }
39 39
40 virtual void SignOut() OVERRIDE; 40 virtual void SignOut() OVERRIDE;
41 virtual void InitTokenService() OVERRIDE; 41 virtual void InitTokenService() OVERRIDE;
42 virtual void StartSignIn(const std::string& username, 42 virtual void StartSignIn(const std::string& username,
43 const std::string& password, 43 const std::string& password,
44 const std::string& login_token, 44 const std::string& login_token,
45 const std::string& login_captcha) OVERRIDE; 45 const std::string& login_captcha) OVERRIDE;
46 46
47 virtual void StartSignInWithCredentials(const std::string& session_index, 47 virtual void StartSignInWithCredentials(const std::string& session_index,
48 const std::string& username, 48 const std::string& username,
49 const std::string& password) OVERRIDE; 49 const std::string& password) OVERRIDE;
50 virtual void StartSignInWithOAuth(const std::string& username, 50 virtual void StartSignInWithOAuth(const std::string& username,
51 const std::string& password) OVERRIDE; 51 const std::string& password) OVERRIDE;
52 52
53 // Helper function to be used with ProfileKeyedService::SetTestingFactory(). 53 // Helper function to be used with ProfileKeyedService::SetTestingFactory().
54 static ProfileKeyedService* Build(Profile* profile); 54 static ProfileKeyedService* Build(content::BrowserContext* profile);
55 }; 55 };
56 56
57 #endif // !defined (OS_CHROMEOS) 57 #endif // !defined (OS_CHROMEOS)
58 58
59 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ 59 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698