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 "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 blocking_task_runner_ = blocking_pool->GetSequencedTaskRunner( | 111 blocking_task_runner_ = blocking_pool->GetSequencedTaskRunner( |
112 blocking_pool->GetSequenceToken()); | 112 blocking_pool->GetSequenceToken()); |
113 | 113 |
114 event_logger_.reset(new EventLogger(kEventLogHistorySize)); | 114 event_logger_.reset(new EventLogger(kEventLogHistorySize)); |
115 if (test_drive_service) { | 115 if (test_drive_service) { |
116 drive_service_.reset(test_drive_service); | 116 drive_service_.reset(test_drive_service); |
117 } else if (google_apis::util::IsDriveV2ApiEnabled()) { | 117 } else if (google_apis::util::IsDriveV2ApiEnabled()) { |
118 drive_service_.reset(new google_apis::DriveAPIService( | 118 drive_service_.reset(new google_apis::DriveAPIService( |
119 g_browser_process->system_request_context(), | 119 g_browser_process->system_request_context(), |
120 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), | 120 GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction), |
| 121 GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction), |
121 GetDriveUserAgent())); | 122 GetDriveUserAgent())); |
122 } else { | 123 } else { |
123 drive_service_.reset(new google_apis::GDataWapiService( | 124 drive_service_.reset(new google_apis::GDataWapiService( |
124 g_browser_process->system_request_context(), | 125 g_browser_process->system_request_context(), |
125 GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction), | 126 GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction), |
126 GetDriveUserAgent())); | 127 GetDriveUserAgent())); |
127 } | 128 } |
128 cache_.reset(new DriveCache(!test_cache_root.empty() ? test_cache_root : | 129 cache_.reset(new DriveCache(!test_cache_root.empty() ? test_cache_root : |
129 DriveCache::GetCacheRootPath(profile), | 130 DriveCache::GetCacheRootPath(profile), |
130 blocking_task_runner_, | 131 blocking_task_runner_, |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 if (factory_for_test_.is_null()) | 437 if (factory_for_test_.is_null()) |
437 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); | 438 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); |
438 else | 439 else |
439 service = factory_for_test_.Run(profile); | 440 service = factory_for_test_.Run(profile); |
440 | 441 |
441 service->Initialize(); | 442 service->Initialize(); |
442 return service; | 443 return service; |
443 } | 444 } |
444 | 445 |
445 } // namespace drive | 446 } // namespace drive |
OLD | NEW |