| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/media_galleries/fileapi/media_file_system_mount_point_p
rovider.h" | 5 #include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_p
rovider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 *error_code = base::PLATFORM_FILE_ERROR_SECURITY; | 132 *error_code = base::PLATFORM_FILE_ERROR_SECURITY; |
| 133 return NULL; | 133 return NULL; |
| 134 } | 134 } |
| 135 return media_copy_or_move_file_validator_factory_.get(); | 135 return media_copy_or_move_file_validator_factory_.get(); |
| 136 default: | 136 default: |
| 137 NOTREACHED(); | 137 NOTREACHED(); |
| 138 } | 138 } |
| 139 return NULL; | 139 return NULL; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void | |
| 143 MediaFileSystemMountPointProvider::InitializeCopyOrMoveFileValidatorFactory( | |
| 144 fileapi::FileSystemType type, | |
| 145 scoped_ptr<fileapi::CopyOrMoveFileValidatorFactory> factory) { | |
| 146 switch (type) { | |
| 147 case fileapi::kFileSystemTypeNativeMedia: | |
| 148 case fileapi::kFileSystemTypeDeviceMedia: | |
| 149 if (!media_copy_or_move_file_validator_factory_) | |
| 150 media_copy_or_move_file_validator_factory_.reset(factory.release()); | |
| 151 break; | |
| 152 default: | |
| 153 NOTREACHED(); | |
| 154 } | |
| 155 } | |
| 156 | |
| 157 fileapi::FilePermissionPolicy | 142 fileapi::FilePermissionPolicy |
| 158 MediaFileSystemMountPointProvider::GetPermissionPolicy( | 143 MediaFileSystemMountPointProvider::GetPermissionPolicy( |
| 159 const FileSystemURL& url, int permissions) const { | 144 const FileSystemURL& url, int permissions) const { |
| 160 // Access to media file systems should be checked using per-filesystem | 145 // Access to media file systems should be checked using per-filesystem |
| 161 // access permission. | 146 // access permission. |
| 162 return fileapi::FILE_PERMISSION_USE_FILESYSTEM_PERMISSION; | 147 return fileapi::FILE_PERMISSION_USE_FILESYSTEM_PERMISSION; |
| 163 } | 148 } |
| 164 | 149 |
| 165 fileapi::FileSystemOperation* | 150 fileapi::FileSystemOperation* |
| 166 MediaFileSystemMountPointProvider::CreateFileSystemOperation( | 151 MediaFileSystemMountPointProvider::CreateFileSystemOperation( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 void MediaFileSystemMountPointProvider::DeleteFileSystem( | 197 void MediaFileSystemMountPointProvider::DeleteFileSystem( |
| 213 const GURL& origin_url, | 198 const GURL& origin_url, |
| 214 fileapi::FileSystemType type, | 199 fileapi::FileSystemType type, |
| 215 FileSystemContext* context, | 200 FileSystemContext* context, |
| 216 const DeleteFileSystemCallback& callback) { | 201 const DeleteFileSystemCallback& callback) { |
| 217 NOTREACHED(); | 202 NOTREACHED(); |
| 218 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); | 203 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); |
| 219 } | 204 } |
| 220 | 205 |
| 221 } // namespace chrome | 206 } // namespace chrome |
| OLD | NEW |