| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/google_apis/drive_notification_manager_factory.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/profiles/profile_dependency_manager.h" | 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 10 #include "chrome/browser/sync/profile_sync_service.h" | 11 #include "chrome/browser/sync/profile_sync_service.h" |
| 11 #include "chrome/browser/sync/profile_sync_service_factory.h" | |
| 12 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" | 12 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
| 13 #include "chrome/browser/sync_file_system/sync_file_system_service.h" | 13 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
| 14 #include "webkit/fileapi/syncable/syncable_file_system_util.h" | 14 #include "webkit/fileapi/syncable/syncable_file_system_util.h" |
| 15 | 15 |
| 16 namespace sync_file_system { | 16 namespace sync_file_system { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 const char kDisableLastWriteWin[] = "disable-syncfs-last-write-win"; | 19 const char kDisableLastWriteWin[] = "disable-syncfs-last-write-win"; |
| 20 } | 20 } |
| 21 | 21 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 void SyncFileSystemServiceFactory::set_mock_remote_file_service( | 34 void SyncFileSystemServiceFactory::set_mock_remote_file_service( |
| 35 scoped_ptr<RemoteFileSyncService> mock_remote_service) { | 35 scoped_ptr<RemoteFileSyncService> mock_remote_service) { |
| 36 mock_remote_file_service_ = mock_remote_service.Pass(); | 36 mock_remote_file_service_ = mock_remote_service.Pass(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 SyncFileSystemServiceFactory::SyncFileSystemServiceFactory() | 39 SyncFileSystemServiceFactory::SyncFileSystemServiceFactory() |
| 40 : ProfileKeyedServiceFactory("SyncFileSystemService", | 40 : ProfileKeyedServiceFactory("SyncFileSystemService", |
| 41 ProfileDependencyManager::GetInstance()) { | 41 ProfileDependencyManager::GetInstance()) { |
| 42 DependsOn(ProfileSyncServiceFactory::GetInstance()); | 42 DependsOn(google_apis::DriveNotificationManagerFactory::GetInstance()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 SyncFileSystemServiceFactory::~SyncFileSystemServiceFactory() {} | 45 SyncFileSystemServiceFactory::~SyncFileSystemServiceFactory() {} |
| 46 | 46 |
| 47 ProfileKeyedService* SyncFileSystemServiceFactory::BuildServiceInstanceFor( | 47 ProfileKeyedService* SyncFileSystemServiceFactory::BuildServiceInstanceFor( |
| 48 Profile* profile) const { | 48 Profile* profile) const { |
| 49 SyncFileSystemService* service = new SyncFileSystemService(profile); | 49 SyncFileSystemService* service = new SyncFileSystemService(profile); |
| 50 | 50 |
| 51 scoped_ptr<LocalFileSyncService> local_file_service( | 51 scoped_ptr<LocalFileSyncService> local_file_service( |
| 52 new LocalFileSyncService(profile)); | 52 new LocalFileSyncService(profile)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 67 remote_file_service->SetConflictResolutionPolicy( | 67 remote_file_service->SetConflictResolutionPolicy( |
| 68 CONFLICT_RESOLUTION_MANUAL); | 68 CONFLICT_RESOLUTION_MANUAL); |
| 69 } | 69 } |
| 70 | 70 |
| 71 service->Initialize(local_file_service.Pass(), | 71 service->Initialize(local_file_service.Pass(), |
| 72 remote_file_service.Pass()); | 72 remote_file_service.Pass()); |
| 73 return service; | 73 return service; |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace sync_file_system | 76 } // namespace sync_file_system |
| OLD | NEW |