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

Side by Side Diff: chrome/browser/chromeos/drive/drive_system_service.cc

Issue 11417109: google_apis: Inject the base WAPI server URL to GDataWapiService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/google_apis/gdata_wapi_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/drive/drive_system_service.h" 5 #include "chrome/browser/chromeos/drive/drive_system_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/drive/drive_api_service.h" 9 #include "chrome/browser/chromeos/drive/drive_api_service.h"
10 #include "chrome/browser/chromeos/drive/drive_download_observer.h" 10 #include "chrome/browser/chromeos/drive/drive_download_observer.h"
11 #include "chrome/browser/chromeos/drive/drive_file_system.h" 11 #include "chrome/browser/chromeos/drive/drive_file_system.h"
12 #include "chrome/browser/chromeos/drive/drive_file_system_proxy.h" 12 #include "chrome/browser/chromeos/drive/drive_file_system_proxy.h"
13 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" 13 #include "chrome/browser/chromeos/drive/drive_file_system_util.h"
14 #include "chrome/browser/chromeos/drive/drive_prefetcher.h" 14 #include "chrome/browser/chromeos/drive/drive_prefetcher.h"
15 #include "chrome/browser/chromeos/drive/drive_sync_client.h" 15 #include "chrome/browser/chromeos/drive/drive_sync_client.h"
16 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h" 16 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h"
17 #include "chrome/browser/chromeos/drive/event_logger.h" 17 #include "chrome/browser/chromeos/drive/event_logger.h"
18 #include "chrome/browser/chromeos/drive/file_write_helper.h" 18 #include "chrome/browser/chromeos/drive/file_write_helper.h"
19 #include "chrome/browser/chromeos/drive/stale_cache_files_remover.h" 19 #include "chrome/browser/chromeos/drive/stale_cache_files_remover.h"
20 #include "chrome/browser/download/download_service.h" 20 #include "chrome/browser/download/download_service.h"
21 #include "chrome/browser/download/download_service_factory.h" 21 #include "chrome/browser/download/download_service_factory.h"
22 #include "chrome/browser/download/download_util.h" 22 #include "chrome/browser/download/download_util.h"
23 #include "chrome/browser/google_apis/drive_api_util.h" 23 #include "chrome/browser/google_apis/drive_api_util.h"
24 #include "chrome/browser/google_apis/drive_uploader.h" 24 #include "chrome/browser/google_apis/drive_uploader.h"
25 #include "chrome/browser/google_apis/gdata_wapi_service.h" 25 #include "chrome/browser/google_apis/gdata_wapi_service.h"
26 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h"
26 #include "chrome/browser/prefs/pref_service.h" 27 #include "chrome/browser/prefs/pref_service.h"
27 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/profiles/profile_dependency_manager.h" 29 #include "chrome/browser/profiles/profile_dependency_manager.h"
29 #include "chrome/browser/sync/profile_sync_service.h" 30 #include "chrome/browser/sync/profile_sync_service.h"
30 #include "chrome/browser/sync/profile_sync_service_factory.h" 31 #include "chrome/browser/sync/profile_sync_service_factory.h"
31 #include "chrome/common/pref_names.h" 32 #include "chrome/common/pref_names.h"
32 #include "content/public/browser/browser_context.h" 33 #include "content/public/browser/browser_context.h"
33 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/storage_partition.h" 35 #include "content/public/browser/storage_partition.h"
35 #include "google/cacheinvalidation/types.pb.h" 36 #include "google/cacheinvalidation/types.pb.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 g_test_cache_root = !cache_root.empty() ? new std::string(cache_root) : NULL; 359 g_test_cache_root = !cache_root.empty() ? new std::string(cache_root) : NULL;
359 } 360 }
360 361
361 ProfileKeyedService* DriveSystemServiceFactory::BuildServiceInstanceFor( 362 ProfileKeyedService* DriveSystemServiceFactory::BuildServiceInstanceFor(
362 Profile* profile) const { 363 Profile* profile) const {
363 DriveSystemService* service = new DriveSystemService(profile); 364 DriveSystemService* service = new DriveSystemService(profile);
364 365
365 google_apis::DriveServiceInterface* drive_service = g_test_drive_service; 366 google_apis::DriveServiceInterface* drive_service = g_test_drive_service;
366 g_test_drive_service = NULL; 367 g_test_drive_service = NULL;
367 if (!drive_service) { 368 if (!drive_service) {
368 if (google_apis::util::IsDriveV2ApiEnabled()) 369 if (google_apis::util::IsDriveV2ApiEnabled()) {
369 drive_service = new DriveAPIService(); 370 drive_service = new DriveAPIService();
370 else 371 } else {
371 drive_service = new google_apis::GDataWapiService(); 372 drive_service = new google_apis::GDataWapiService(
373 GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction));
374 }
372 } 375 }
373 376
374 FilePath cache_root = 377 FilePath cache_root =
375 g_test_cache_root ? FilePath(*g_test_cache_root) : 378 g_test_cache_root ? FilePath(*g_test_cache_root) :
376 DriveCache::GetCacheRootPath(profile); 379 DriveCache::GetCacheRootPath(profile);
377 delete g_test_cache_root; 380 delete g_test_cache_root;
378 g_test_cache_root = NULL; 381 g_test_cache_root = NULL;
379 382
380 service->Initialize(drive_service, cache_root); 383 service->Initialize(drive_service, cache_root);
381 return service; 384 return service;
382 } 385 }
383 386
384 } // namespace drive 387 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/google_apis/gdata_wapi_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698