| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fileapi/file_system_backend.h" | 5 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> |
| 10 | 11 |
| 11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 14 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h" | 15 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h" |
| 15 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" | 16 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" |
| 16 #include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h" | 17 #include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h" |
| 17 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 18 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
| 18 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 19 #include "chromeos/chromeos_switches.h" | 20 #include "chromeos/chromeos_switches.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 storage::FileSystemType type) { | 295 storage::FileSystemType type) { |
| 295 if (type == storage::kFileSystemTypeProvided) | 296 if (type == storage::kFileSystemTypeProvided) |
| 296 return file_system_provider_delegate_->GetWatcherManager(type); | 297 return file_system_provider_delegate_->GetWatcherManager(type); |
| 297 | 298 |
| 298 if (type == storage::kFileSystemTypeDeviceMediaAsFileStorage && | 299 if (type == storage::kFileSystemTypeDeviceMediaAsFileStorage && |
| 299 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 300 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 300 chromeos::switches::kDisableMtpWriteSupport)) { | 301 chromeos::switches::kDisableMtpWriteSupport)) { |
| 301 return mtp_delegate_->GetWatcherManager(type); | 302 return mtp_delegate_->GetWatcherManager(type); |
| 302 } | 303 } |
| 303 | 304 |
| 305 if (type == storage::kFileSystemTypeArcDocumentsProvider) |
| 306 return arc_documents_provider_delegate_->GetWatcherManager(type); |
| 307 |
| 304 // TODO(mtomasz): Add support for other backends. | 308 // TODO(mtomasz): Add support for other backends. |
| 305 return NULL; | 309 return NULL; |
| 306 } | 310 } |
| 307 | 311 |
| 308 storage::CopyOrMoveFileValidatorFactory* | 312 storage::CopyOrMoveFileValidatorFactory* |
| 309 FileSystemBackend::GetCopyOrMoveFileValidatorFactory( | 313 FileSystemBackend::GetCopyOrMoveFileValidatorFactory( |
| 310 storage::FileSystemType type, | 314 storage::FileSystemType type, |
| 311 base::File::Error* error_code) { | 315 base::File::Error* error_code) { |
| 312 DCHECK(error_code); | 316 DCHECK(error_code); |
| 313 *error_code = base::File::FILE_OK; | 317 *error_code = base::File::FILE_OK; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 const base::FilePath& entry_path) const { | 490 const base::FilePath& entry_path) const { |
| 487 base::FilePath virtual_path; | 491 base::FilePath virtual_path; |
| 488 if (!GetVirtualPath(entry_path, &virtual_path)) | 492 if (!GetVirtualPath(entry_path, &virtual_path)) |
| 489 return storage::FileSystemURL(); | 493 return storage::FileSystemURL(); |
| 490 | 494 |
| 491 return context->CreateCrackedFileSystemURL( | 495 return context->CreateCrackedFileSystemURL( |
| 492 GURL() /* origin */, storage::kFileSystemTypeExternal, virtual_path); | 496 GURL() /* origin */, storage::kFileSystemTypeExternal, virtual_path); |
| 493 } | 497 } |
| 494 | 498 |
| 495 } // namespace chromeos | 499 } // namespace chromeos |
| OLD | NEW |