1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/sync_file_system/remote_file_sync_service.h"
7 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h"
8 #include "chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_service.h"
10 namespace sync_file_system
{
12 scoped_ptr
<RemoteFileSyncService
>
13 RemoteFileSyncService::CreateForBrowserContext(
14 BackendVersion version
,
15 content::BrowserContext
* context
) {
18 return DriveFileSyncService::Create(
19 Profile::FromBrowserContext(context
)).PassAs
<RemoteFileSyncService
>();
21 return drive_backend::SyncEngine::CreateForBrowserContext(
22 context
).PassAs
<RemoteFileSyncService
>();
24 NOTREACHED() << "Unknown version " << version
;
25 return scoped_ptr
<RemoteFileSyncService
>();
28 void RemoteFileSyncService::AppendDependsOnFactories(
29 BackendVersion version
,
30 std::set
<BrowserContextKeyedServiceFactory
*>* factories
) {
33 DriveFileSyncService::AppendDependsOnFactories(factories
);
36 drive_backend::SyncEngine::AppendDependsOnFactories(factories
);
39 NOTREACHED() << "Unknown version " << version
;
42 } // namespace sync_file_system