| 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::GetAlternativeURL( |
| 391 const storage::FileSystemURL& url, |
| 392 base::Callback<void(const GURL& url)> callback) { |
| 393 |
| 394 switch (url.type()) { |
| 395 case storage::kFileSystemTypeDrive: |
| 396 drive_delegate_->GetAlternativeURL(url, callback); |
| 397 return; |
| 398 case storage::kFileSystemTypeProvided: |
| 399 file_system_provider_delegate_->GetAlternativeURL(url, callback); |
| 400 return; |
| 401 case storage::kFileSystemTypeDeviceMediaAsFileStorage: |
| 402 mtp_delegate_->GetAlternativeURL(url, callback); |
| 403 return; |
| 404 case storage::kFileSystemTypeNativeLocal: |
| 405 case storage::kFileSystemTypeRestrictedNativeLocal: |
| 406 callback.Run(GURL()); |
| 407 return; |
| 408 default: |
| 409 NOTREACHED(); |
| 410 callback.Run(GURL()); |
| 411 return; |
| 412 } |
| 413 } |
| 414 |
| 390 } // namespace chromeos | 415 } // namespace chromeos |
| OLD | NEW |