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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "base/prefs/testing_pref_store.h" | 6 #include "base/prefs/testing_pref_store.h" |
| 7 #include "chrome/browser/managed_mode/managed_user_signin_manager_wrapper.h" |
7 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 8 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
8 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
9 #include "chrome/browser/signin/signin_manager.h" | 10 #include "chrome/browser/signin/signin_manager.h" |
10 #include "chrome/browser/signin/signin_manager_factory.h" | 11 #include "chrome/browser/signin/signin_manager_factory.h" |
11 #include "chrome/browser/sync/profile_sync_service_mock.h" | 12 #include "chrome/browser/sync/profile_sync_service_mock.h" |
12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
13 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
14 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
15 | 16 |
16 ProfileSyncServiceMock::ProfileSyncServiceMock(Profile* profile) | 17 ProfileSyncServiceMock::ProfileSyncServiceMock(Profile* profile) |
17 : ProfileSyncService( | 18 : ProfileSyncService( |
18 NULL, | 19 NULL, |
19 profile, | 20 profile, |
20 SigninManagerFactory::GetForProfile(profile), | 21 new ManagedUserSigninManagerWrapper( |
| 22 SigninManagerFactory::GetForProfile(profile)), |
21 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 23 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
22 ProfileSyncService::MANUAL_START) {} | 24 ProfileSyncService::MANUAL_START) {} |
23 | 25 |
24 ProfileSyncServiceMock::~ProfileSyncServiceMock() { | 26 ProfileSyncServiceMock::~ProfileSyncServiceMock() { |
25 } | 27 } |
26 | 28 |
27 // static | 29 // static |
28 TestingProfile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { | 30 TestingProfile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { |
29 TestingProfile* profile = new TestingProfile(); | 31 TestingProfile* profile = new TestingProfile(); |
30 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "foo"); | 32 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "foo"); |
(...skipping 12 matching lines...) Expand all Loading... |
43 std::vector<browser_sync::DeviceInfo*>* device_vector = | 45 std::vector<browser_sync::DeviceInfo*>* device_vector = |
44 GetAllSignedInDevicesMock(); | 46 GetAllSignedInDevicesMock(); |
45 devices.get() = *device_vector; | 47 devices.get() = *device_vector; |
46 return devices.Pass(); | 48 return devices.Pass(); |
47 } | 49 } |
48 | 50 |
49 scoped_ptr<browser_sync::DeviceInfo> | 51 scoped_ptr<browser_sync::DeviceInfo> |
50 ProfileSyncServiceMock::GetLocalDeviceInfo() const { | 52 ProfileSyncServiceMock::GetLocalDeviceInfo() const { |
51 return scoped_ptr<browser_sync::DeviceInfo>(GetLocalDeviceInfoMock()).Pass(); | 53 return scoped_ptr<browser_sync::DeviceInfo>(GetLocalDeviceInfoMock()).Pass(); |
52 } | 54 } |
OLD | NEW |