| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void FileSystemBackend::OpenFileSystem( | 109 void FileSystemBackend::OpenFileSystem( |
| 110 const GURL& origin_url, | 110 const GURL& origin_url, |
| 111 fileapi::FileSystemType type, | 111 fileapi::FileSystemType type, |
| 112 fileapi::OpenFileSystemMode mode, | 112 fileapi::OpenFileSystemMode mode, |
| 113 const OpenFileSystemCallback& callback) { | 113 const OpenFileSystemCallback& callback) { |
| 114 DCHECK(fileapi::IsolatedContext::IsIsolatedType(type)); | 114 DCHECK(fileapi::IsolatedContext::IsIsolatedType(type)); |
| 115 // Nothing to validate for external filesystem. | 115 // Nothing to validate for external filesystem. |
| 116 callback.Run(base::PLATFORM_FILE_OK); | 116 callback.Run(GetFileSystemRootURI(origin_url, type), |
| 117 GetFileSystemName(origin_url, type), |
| 118 base::PLATFORM_FILE_OK); |
| 117 } | 119 } |
| 118 | 120 |
| 119 fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() { | 121 fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() { |
| 120 // No quota support. | 122 // No quota support. |
| 121 return NULL; | 123 return NULL; |
| 122 } | 124 } |
| 123 | 125 |
| 124 bool FileSystemBackend::IsAccessAllowed( | 126 bool FileSystemBackend::IsAccessAllowed( |
| 125 const fileapi::FileSystemURL& url) const { | 127 const fileapi::FileSystemURL& url) const { |
| 126 if (!url.is_valid()) | 128 if (!url.is_valid()) |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 std::string mount_name = url.filesystem_id(); | 314 std::string mount_name = url.filesystem_id(); |
| 313 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && | 315 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && |
| 314 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { | 316 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { |
| 315 return base::FilePath(); | 317 return base::FilePath(); |
| 316 } | 318 } |
| 317 | 319 |
| 318 return root_path.DirName(); | 320 return root_path.DirName(); |
| 319 } | 321 } |
| 320 | 322 |
| 321 } // namespace chromeos | 323 } // namespace chromeos |
| OLD | NEW |