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/gdata/gdata_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 is_recursive(is_recursive), | 396 is_recursive(is_recursive), |
397 callback(callback) { | 397 callback(callback) { |
398 } | 398 } |
399 | 399 |
400 GDataFileSystem::CreateDirectoryParams::~CreateDirectoryParams() { | 400 GDataFileSystem::CreateDirectoryParams::~CreateDirectoryParams() { |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 // GDataFileSystem class implementatsion. | 404 // GDataFileSystem class implementatsion. |
405 | 405 |
406 GDataFileSystem::GDataFileSystem(Profile* profile) | 406 GDataFileSystem::GDataFileSystem(Profile* profile, |
| 407 DocumentsServiceInterface* documents_service) |
407 : profile_(profile), | 408 : profile_(profile), |
408 documents_service_(new DocumentsService), | 409 documents_service_(documents_service), |
409 gdata_uploader_(new GDataUploader(ALLOW_THIS_IN_INITIALIZER_LIST(this))), | 410 gdata_uploader_(new GDataUploader(ALLOW_THIS_IN_INITIALIZER_LIST(this))), |
410 gdata_download_observer_(new GDataDownloadObserver()), | 411 gdata_download_observer_(new GDataDownloadObserver()), |
411 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 412 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
412 documents_service_->Initialize(profile_); | 413 documents_service_->Initialize(profile_); |
413 | 414 |
414 // download_manager will be NULL for unit tests. | 415 // download_manager will be NULL for unit tests. |
415 content::DownloadManager* download_manager = | 416 content::DownloadManager* download_manager = |
416 g_browser_process->download_status_updater() ? | 417 g_browser_process->download_status_updater() ? |
417 DownloadServiceFactory::GetForProfile(profile)->GetDownloadManager() : | 418 DownloadServiceFactory::GetForProfile(profile)->GetDownloadManager() : |
418 NULL; | 419 NULL; |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 GDataFileSystemFactory::GDataFileSystemFactory() | 1116 GDataFileSystemFactory::GDataFileSystemFactory() |
1116 : ProfileKeyedServiceFactory("GDataFileSystem", | 1117 : ProfileKeyedServiceFactory("GDataFileSystem", |
1117 ProfileDependencyManager::GetInstance()) { | 1118 ProfileDependencyManager::GetInstance()) { |
1118 } | 1119 } |
1119 | 1120 |
1120 GDataFileSystemFactory::~GDataFileSystemFactory() { | 1121 GDataFileSystemFactory::~GDataFileSystemFactory() { |
1121 } | 1122 } |
1122 | 1123 |
1123 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( | 1124 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( |
1124 Profile* profile) const { | 1125 Profile* profile) const { |
1125 return new GDataFileSystem(profile); | 1126 return new GDataFileSystem(profile, new DocumentsService); |
1126 } | 1127 } |
1127 | 1128 |
1128 } // namespace gdata | 1129 } // namespace gdata |
OLD | NEW |