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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 return scoped_ptr<storage::FileStreamWriter>(); | 380 return scoped_ptr<storage::FileStreamWriter>(); |
381 } | 381 } |
382 | 382 |
383 bool FileSystemBackend::GetVirtualPath( | 383 bool FileSystemBackend::GetVirtualPath( |
384 const base::FilePath& filesystem_path, | 384 const base::FilePath& filesystem_path, |
385 base::FilePath* virtual_path) { | 385 base::FilePath* virtual_path) { |
386 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) || | 386 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) || |
387 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path); | 387 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path); |
388 } | 388 } |
389 | 389 |
| 390 void FileSystemBackend::GetRedirectURLForContents( |
| 391 const storage::FileSystemURL& url, |
| 392 const storage::URLCallback& callback) { |
| 393 DCHECK(url.is_valid()); |
| 394 |
| 395 if (!IsAccessAllowed(url)) |
| 396 return callback.Run(GURL()); |
| 397 |
| 398 switch (url.type()) { |
| 399 case storage::kFileSystemTypeDrive: |
| 400 drive_delegate_->GetRedirectURLForContents(url, callback); |
| 401 return; |
| 402 case storage::kFileSystemTypeProvided: |
| 403 file_system_provider_delegate_->GetRedirectURLForContents(url, |
| 404 callback); |
| 405 return; |
| 406 case storage::kFileSystemTypeDeviceMediaAsFileStorage: |
| 407 mtp_delegate_->GetRedirectURLForContents(url, callback); |
| 408 return; |
| 409 case storage::kFileSystemTypeNativeLocal: |
| 410 case storage::kFileSystemTypeRestrictedNativeLocal: |
| 411 callback.Run(GURL()); |
| 412 return; |
| 413 default: |
| 414 NOTREACHED(); |
| 415 } |
| 416 callback.Run(GURL()); |
| 417 } |
| 418 |
390 } // namespace chromeos | 419 } // namespace chromeos |
OLD | NEW |