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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" | 10 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 bool FileSystemBackend::CanHandleType(fileapi::FileSystemType type) const { | 76 bool FileSystemBackend::CanHandleType(fileapi::FileSystemType type) const { |
77 switch (type) { | 77 switch (type) { |
78 case fileapi::kFileSystemTypeExternal: | 78 case fileapi::kFileSystemTypeExternal: |
79 case fileapi::kFileSystemTypeDrive: | 79 case fileapi::kFileSystemTypeDrive: |
80 case fileapi::kFileSystemTypeRestrictedNativeLocal: | 80 case fileapi::kFileSystemTypeRestrictedNativeLocal: |
81 case fileapi::kFileSystemTypeNativeLocal: | 81 case fileapi::kFileSystemTypeNativeLocal: |
82 case fileapi::kFileSystemTypeNativeForPlatformApp: | 82 case fileapi::kFileSystemTypeNativeForPlatformApp: |
83 case fileapi::kFileSystemTypeDeviceMediaAsFileStorage: | 83 case fileapi::kFileSystemTypeDeviceMediaAsFileStorage: |
| 84 case fileapi::kFileSystemTypeProvided: |
84 return true; | 85 return true; |
85 default: | 86 default: |
86 return false; | 87 return false; |
87 } | 88 } |
88 } | 89 } |
89 | 90 |
90 void FileSystemBackend::Initialize(fileapi::FileSystemContext* context) { | 91 void FileSystemBackend::Initialize(fileapi::FileSystemContext* context) { |
91 } | 92 } |
92 | 93 |
93 void FileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url, | 94 void FileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 if (url.type() == fileapi::kFileSystemTypeDeviceMediaAsFileStorage) { | 261 if (url.type() == fileapi::kFileSystemTypeDeviceMediaAsFileStorage) { |
261 // MTP file operations run on MediaTaskRunner. | 262 // MTP file operations run on MediaTaskRunner. |
262 return fileapi::FileSystemOperation::Create( | 263 return fileapi::FileSystemOperation::Create( |
263 url, context, | 264 url, context, |
264 make_scoped_ptr(new fileapi::FileSystemOperationContext( | 265 make_scoped_ptr(new fileapi::FileSystemOperationContext( |
265 context, MediaFileSystemBackend::MediaTaskRunner()))); | 266 context, MediaFileSystemBackend::MediaTaskRunner()))); |
266 } | 267 } |
267 | 268 |
268 DCHECK(url.type() == fileapi::kFileSystemTypeNativeLocal || | 269 DCHECK(url.type() == fileapi::kFileSystemTypeNativeLocal || |
269 url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal || | 270 url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal || |
270 url.type() == fileapi::kFileSystemTypeDrive); | 271 url.type() == fileapi::kFileSystemTypeDrive || |
| 272 url.type() == fileapi::kFileSystemTypeProvided); |
271 return fileapi::FileSystemOperation::Create( | 273 return fileapi::FileSystemOperation::Create( |
272 url, context, | 274 url, context, |
273 make_scoped_ptr(new fileapi::FileSystemOperationContext(context))); | 275 make_scoped_ptr(new fileapi::FileSystemOperationContext(context))); |
274 } | 276 } |
275 | 277 |
276 bool FileSystemBackend::SupportsStreaming( | 278 bool FileSystemBackend::SupportsStreaming( |
277 const fileapi::FileSystemURL& url) const { | 279 const fileapi::FileSystemURL& url) const { |
278 return url.type() == fileapi::kFileSystemTypeDrive; | 280 return url.type() == fileapi::kFileSystemTypeDrive; |
279 } | 281 } |
280 | 282 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } | 345 } |
344 | 346 |
345 bool FileSystemBackend::GetVirtualPath( | 347 bool FileSystemBackend::GetVirtualPath( |
346 const base::FilePath& filesystem_path, | 348 const base::FilePath& filesystem_path, |
347 base::FilePath* virtual_path) { | 349 base::FilePath* virtual_path) { |
348 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) || | 350 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) || |
349 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path); | 351 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path); |
350 } | 352 } |
351 | 353 |
352 } // namespace chromeos | 354 } // namespace chromeos |
OLD | NEW |