Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_system_service.cc

Issue 10829375: Cleanup: separate WAPI and Drive API code in gdata_documents_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/chromeos/gdata/gdata_system_service.h" 5 #include "chrome/browser/chromeos/gdata/gdata_system_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/gdata/drive_api_service.h"
10 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" 11 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h"
11 #include "chrome/browser/chromeos/gdata/file_write_helper.h" 12 #include "chrome/browser/chromeos/gdata/file_write_helper.h"
12 #include "chrome/browser/chromeos/gdata/gdata_contacts_service.h" 13 #include "chrome/browser/chromeos/gdata/gdata_contacts_service.h"
13 #include "chrome/browser/chromeos/gdata/gdata_documents_service.h"
14 #include "chrome/browser/chromeos/gdata/gdata_download_observer.h" 14 #include "chrome/browser/chromeos/gdata/gdata_download_observer.h"
15 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" 15 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
16 #include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h" 16 #include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h"
17 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h" 17 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h"
18 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" 18 #include "chrome/browser/chromeos/gdata/gdata_uploader.h"
19 #include "chrome/browser/chromeos/gdata/gdata_util.h" 19 #include "chrome/browser/chromeos/gdata/gdata_util.h"
20 #include "chrome/browser/chromeos/gdata/gdata_wapi_service.h"
20 #include "chrome/browser/download/download_service.h" 21 #include "chrome/browser/download/download_service.h"
21 #include "chrome/browser/download/download_service_factory.h" 22 #include "chrome/browser/download/download_service_factory.h"
22 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/profiles/profile_dependency_manager.h" 24 #include "chrome/browser/profiles/profile_dependency_manager.h"
24 #include "content/public/browser/browser_context.h" 25 #include "content/public/browser/browser_context.h"
25 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
26 #include "webkit/fileapi/file_system_context.h" 27 #include "webkit/fileapi/file_system_context.h"
27 #include "webkit/fileapi/file_system_mount_point_provider.h" 28 #include "webkit/fileapi/file_system_mount_point_provider.h"
28 29
29 using content::BrowserContext; 30 using content::BrowserContext;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 delete g_test_cache_root; 205 delete g_test_cache_root;
205 g_test_cache_root = !cache_root.empty() ? new std::string(cache_root) : NULL; 206 g_test_cache_root = !cache_root.empty() ? new std::string(cache_root) : NULL;
206 } 207 }
207 208
208 ProfileKeyedService* GDataSystemServiceFactory::BuildServiceInstanceFor( 209 ProfileKeyedService* GDataSystemServiceFactory::BuildServiceInstanceFor(
209 Profile* profile) const { 210 Profile* profile) const {
210 GDataSystemService* service = new GDataSystemService(profile); 211 GDataSystemService* service = new GDataSystemService(profile);
211 212
212 DocumentsServiceInterface* documents_service = 213 DocumentsServiceInterface* documents_service =
213 g_test_documents_service ? g_test_documents_service : 214 g_test_documents_service ? g_test_documents_service :
214 new DocumentsService(); 215 util::IsDriveV2ApiEnabled() ?
satorux1 2012/08/17 12:05:48 please don't nest ternary operators. very hard to
kochi 2012/08/20 09:17:30 Done.
216 reinterpret_cast<DocumentsServiceInterface*>(new DriveAPIService()) :
217 reinterpret_cast<DocumentsServiceInterface*>(new GDataWapiService());
215 g_test_documents_service = NULL; 218 g_test_documents_service = NULL;
216 219
217 FilePath cache_root = 220 FilePath cache_root =
218 g_test_cache_root ? FilePath(*g_test_cache_root) : 221 g_test_cache_root ? FilePath(*g_test_cache_root) :
219 GDataCache::GetCacheRootPath(profile); 222 GDataCache::GetCacheRootPath(profile);
220 delete g_test_cache_root; 223 delete g_test_cache_root;
221 g_test_cache_root = NULL; 224 g_test_cache_root = NULL;
222 225
223 service->Initialize(documents_service, cache_root); 226 service->Initialize(documents_service, cache_root);
224 return service; 227 return service;
225 } 228 }
226 229
227 } // namespace gdata 230 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698