OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/sync_file_system/sync_file_system_service_factory.h" | 5 #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/sync_file_system/local/local_file_sync_service.h" | 11 #include "chrome/browser/sync_file_system/local/local_file_sync_service.h" |
12 #include "chrome/browser/sync_file_system/sync_file_system_service.h" | 12 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
13 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 13 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
14 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
15 #include "extensions/browser/extension_registry_factory.h" | 15 #include "extensions/browser/extension_registry_factory.h" |
16 | 16 |
17 namespace sync_file_system { | 17 namespace sync_file_system { |
18 | 18 |
19 // static | 19 // static |
20 SyncFileSystemService* SyncFileSystemServiceFactory::GetForProfile( | 20 SyncFileSystemService* SyncFileSystemServiceFactory::GetForProfile( |
21 Profile* profile) { | 21 Profile* profile) { |
22 return static_cast<SyncFileSystemService*>( | 22 return static_cast<SyncFileSystemService*>( |
23 GetInstance()->GetServiceForBrowserContext(profile, true)); | 23 GetInstance()->GetServiceForBrowserContext(profile, true)); |
24 } | 24 } |
25 | 25 |
26 // static | 26 // static |
27 SyncFileSystemServiceFactory* SyncFileSystemServiceFactory::GetInstance() { | 27 SyncFileSystemServiceFactory* SyncFileSystemServiceFactory::GetInstance() { |
28 return Singleton<SyncFileSystemServiceFactory>::get(); | 28 return base::Singleton<SyncFileSystemServiceFactory>::get(); |
29 } | 29 } |
30 | 30 |
31 void SyncFileSystemServiceFactory::set_mock_local_file_service( | 31 void SyncFileSystemServiceFactory::set_mock_local_file_service( |
32 scoped_ptr<LocalFileSyncService> mock_local_service) { | 32 scoped_ptr<LocalFileSyncService> mock_local_service) { |
33 mock_local_file_service_ = mock_local_service.Pass(); | 33 mock_local_file_service_ = mock_local_service.Pass(); |
34 } | 34 } |
35 | 35 |
36 void SyncFileSystemServiceFactory::set_mock_remote_file_service( | 36 void SyncFileSystemServiceFactory::set_mock_remote_file_service( |
37 scoped_ptr<RemoteFileSyncService> mock_remote_service) { | 37 scoped_ptr<RemoteFileSyncService> mock_remote_service) { |
38 mock_remote_file_service_ = mock_remote_service.Pass(); | 38 mock_remote_file_service_ = mock_remote_service.Pass(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 remote_file_service = RemoteFileSyncService::CreateForBrowserContext( | 74 remote_file_service = RemoteFileSyncService::CreateForBrowserContext( |
75 context, service->task_logger()); | 75 context, service->task_logger()); |
76 } | 76 } |
77 | 77 |
78 service->Initialize(local_file_service.Pass(), | 78 service->Initialize(local_file_service.Pass(), |
79 remote_file_service.Pass()); | 79 remote_file_service.Pass()); |
80 return service; | 80 return service; |
81 } | 81 } |
82 | 82 |
83 } // namespace sync_file_system | 83 } // namespace sync_file_system |
OLD | NEW |