Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync_file_system / remote_file_sync_service.cc
blob522146c100081e4486beda18de63bec1bc1977b4
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) {
16 switch (version) {
17 case V1:
18 return DriveFileSyncService::Create(
19 Profile::FromBrowserContext(context)).PassAs<RemoteFileSyncService>();
20 case V2:
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) {
31 switch (version) {
32 case V1:
33 DriveFileSyncService::AppendDependsOnFactories(factories);
34 return;
35 case V2:
36 drive_backend::SyncEngine::AppendDependsOnFactories(factories);
37 return;
39 NOTREACHED() << "Unknown version " << version;
42 } // namespace sync_file_system