OLD | NEW |
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 "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/drive/drive_api_service.h" | 10 #include "chrome/browser/chromeos/drive/drive_api_service.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 base::SequencedWorkerPool* blocking_pool = BrowserThread::GetBlockingPool(); | 117 base::SequencedWorkerPool* blocking_pool = BrowserThread::GetBlockingPool(); |
118 blocking_task_runner_ = blocking_pool->GetSequencedTaskRunner( | 118 blocking_task_runner_ = blocking_pool->GetSequencedTaskRunner( |
119 blocking_pool->GetSequenceToken()); | 119 blocking_pool->GetSequenceToken()); |
120 | 120 |
121 event_logger_.reset(new EventLogger(kEventLogHistorySize)); | 121 event_logger_.reset(new EventLogger(kEventLogHistorySize)); |
122 if (test_drive_service) { | 122 if (test_drive_service) { |
123 drive_service_.reset(test_drive_service); | 123 drive_service_.reset(test_drive_service); |
124 } else if (google_apis::util::IsDriveV2ApiEnabled()) { | 124 } else if (google_apis::util::IsDriveV2ApiEnabled()) { |
125 drive_service_.reset(new DriveAPIService( | 125 drive_service_.reset(new DriveAPIService( |
126 g_browser_process->system_request_context(), | 126 g_browser_process->system_request_context(), |
| 127 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), |
127 GetDriveUserAgent())); | 128 GetDriveUserAgent())); |
128 } else { | 129 } else { |
129 drive_service_.reset(new google_apis::GDataWapiService( | 130 drive_service_.reset(new google_apis::GDataWapiService( |
130 g_browser_process->system_request_context(), | 131 g_browser_process->system_request_context(), |
131 GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction), | 132 GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction), |
132 GetDriveUserAgent())); | 133 GetDriveUserAgent())); |
133 } | 134 } |
134 cache_.reset(new DriveCache(!test_cache_root.empty() ? test_cache_root : | 135 cache_.reset(new DriveCache(!test_cache_root.empty() ? test_cache_root : |
135 DriveCache::GetCacheRootPath(profile), | 136 DriveCache::GetCacheRootPath(profile), |
136 blocking_task_runner_, | 137 blocking_task_runner_, |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 if (factory_for_test_.is_null()) | 410 if (factory_for_test_.is_null()) |
410 service = new DriveSystemService(profile, NULL, FilePath(), NULL); | 411 service = new DriveSystemService(profile, NULL, FilePath(), NULL); |
411 else | 412 else |
412 service = factory_for_test_.Run(profile); | 413 service = factory_for_test_.Run(profile); |
413 | 414 |
414 service->Initialize(); | 415 service->Initialize(); |
415 return service; | 416 return service; |
416 } | 417 } |
417 | 418 |
418 } // namespace drive | 419 } // namespace drive |
OLD | NEW |