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_builder.h" | 5 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "build/build_config.h" | 9 #include "build/build_config.h" |
8 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/signin/account_tracker_service_factory.h" | 11 #include "chrome/browser/signin/account_tracker_service_factory.h" |
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 12 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
11 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" | 13 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" |
12 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
13 #include "chrome/browser/signin/signin_manager_factory.h" | 15 #include "chrome/browser/signin/signin_manager_factory.h" |
14 | 16 |
15 scoped_ptr<KeyedService> BuildFakeSigninManagerBase( | 17 scoped_ptr<KeyedService> BuildFakeSigninManagerBase( |
16 content::BrowserContext* context) { | 18 content::BrowserContext* context) { |
17 scoped_ptr<SigninManagerBase> manager; | 19 scoped_ptr<SigninManagerBase> manager; |
18 Profile* profile = static_cast<Profile*>(context); | 20 Profile* profile = static_cast<Profile*>(context); |
19 manager.reset(new FakeSigninManagerForTesting(profile)); | 21 manager.reset(new FakeSigninManagerForTesting(profile)); |
20 manager->Initialize(nullptr); | 22 manager->Initialize(nullptr); |
21 SigninManagerFactory::GetInstance() | 23 SigninManagerFactory::GetInstance() |
22 ->NotifyObserversOfSigninManagerCreationForTesting(manager.get()); | 24 ->NotifyObserversOfSigninManagerCreationForTesting(manager.get()); |
23 return manager.Pass(); | 25 return std::move(manager); |
24 } | 26 } |
25 | 27 |
26 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
27 FakeSigninManagerForTesting::FakeSigninManagerForTesting(Profile* profile) | 29 FakeSigninManagerForTesting::FakeSigninManagerForTesting(Profile* profile) |
28 : FakeSigninManagerBase( | 30 : FakeSigninManagerBase( |
29 ChromeSigninClientFactory::GetForProfile(profile), | 31 ChromeSigninClientFactory::GetForProfile(profile), |
30 AccountTrackerServiceFactory::GetForProfile(profile)) {} | 32 AccountTrackerServiceFactory::GetForProfile(profile)) {} |
31 #else | 33 #else |
32 FakeSigninManagerForTesting::FakeSigninManagerForTesting(Profile* profile) | 34 FakeSigninManagerForTesting::FakeSigninManagerForTesting(Profile* profile) |
33 : FakeSigninManager( | 35 : FakeSigninManager( |
34 ChromeSigninClientFactory::GetForProfile(profile), | 36 ChromeSigninClientFactory::GetForProfile(profile), |
35 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 37 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
36 AccountTrackerServiceFactory::GetForProfile(profile), | 38 AccountTrackerServiceFactory::GetForProfile(profile), |
37 GaiaCookieManagerServiceFactory::GetForProfile(profile)) {} | 39 GaiaCookieManagerServiceFactory::GetForProfile(profile)) {} |
38 #endif | 40 #endif |
OLD | NEW |