| 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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_MOUNT_POINT_PRO
VIDER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_MOUNT_POINT_PRO
VIDER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "webkit/browser/fileapi/file_system_mount_point_provider.h" | 10 #include "webkit/browser/fileapi/file_system_backend.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class SequencedTaskRunner; | 13 class SequencedTaskRunner; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace fileapi { | 16 namespace fileapi { |
| 17 class AsyncFileUtilAdapter; | 17 class AsyncFileUtilAdapter; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace chrome { | 20 namespace chrome { |
| 21 | 21 |
| 22 class MediaPathFilter; | 22 class MediaPathFilter; |
| 23 | 23 |
| 24 class DeviceMediaAsyncFileUtil; | 24 class DeviceMediaAsyncFileUtil; |
| 25 | 25 |
| 26 class MediaFileSystemMountPointProvider | 26 class MediaFileSystemBackend : public fileapi::FileSystemBackend { |
| 27 : public fileapi::FileSystemMountPointProvider { | |
| 28 public: | 27 public: |
| 29 static const char kMediaTaskRunnerName[]; | 28 static const char kMediaTaskRunnerName[]; |
| 30 static const char kMediaPathFilterKey[]; | 29 static const char kMediaPathFilterKey[]; |
| 31 static const char kMTPDeviceDelegateURLKey[]; | 30 static const char kMTPDeviceDelegateURLKey[]; |
| 32 | 31 |
| 33 MediaFileSystemMountPointProvider( | 32 MediaFileSystemBackend( |
| 34 const base::FilePath& profile_path, | 33 const base::FilePath& profile_path, |
| 35 base::SequencedTaskRunner* media_task_runner); | 34 base::SequencedTaskRunner* media_task_runner); |
| 36 virtual ~MediaFileSystemMountPointProvider(); | 35 virtual ~MediaFileSystemBackend(); |
| 37 | 36 |
| 38 static bool CurrentlyOnMediaTaskRunnerThread(); | 37 static bool CurrentlyOnMediaTaskRunnerThread(); |
| 39 static scoped_refptr<base::SequencedTaskRunner> MediaTaskRunner(); | 38 static scoped_refptr<base::SequencedTaskRunner> MediaTaskRunner(); |
| 40 | 39 |
| 41 // FileSystemMountPointProvider implementation. | 40 // FileSystemBackend implementation. |
| 42 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; | 41 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; |
| 43 virtual void OpenFileSystem( | 42 virtual void OpenFileSystem( |
| 44 const GURL& origin_url, | 43 const GURL& origin_url, |
| 45 fileapi::FileSystemType type, | 44 fileapi::FileSystemType type, |
| 46 fileapi::OpenFileSystemMode mode, | 45 fileapi::OpenFileSystemMode mode, |
| 47 const OpenFileSystemCallback& callback) OVERRIDE; | 46 const OpenFileSystemCallback& callback) OVERRIDE; |
| 48 virtual fileapi::FileSystemFileUtil* GetFileUtil( | 47 virtual fileapi::FileSystemFileUtil* GetFileUtil( |
| 49 fileapi::FileSystemType type) OVERRIDE; | 48 fileapi::FileSystemType type) OVERRIDE; |
| 50 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( | 49 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( |
| 51 fileapi::FileSystemType type) OVERRIDE; | 50 fileapi::FileSystemType type) OVERRIDE; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 78 scoped_ptr<fileapi::CopyOrMoveFileValidatorFactory> | 77 scoped_ptr<fileapi::CopyOrMoveFileValidatorFactory> |
| 79 media_copy_or_move_file_validator_factory_; | 78 media_copy_or_move_file_validator_factory_; |
| 80 | 79 |
| 81 scoped_ptr<fileapi::AsyncFileUtil> native_media_file_util_; | 80 scoped_ptr<fileapi::AsyncFileUtil> native_media_file_util_; |
| 82 scoped_ptr<DeviceMediaAsyncFileUtil> device_media_async_file_util_; | 81 scoped_ptr<DeviceMediaAsyncFileUtil> device_media_async_file_util_; |
| 83 #if defined(OS_WIN) || defined(OS_MACOSX) | 82 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 84 scoped_ptr<fileapi::AsyncFileUtil> picasa_file_util_; | 83 scoped_ptr<fileapi::AsyncFileUtil> picasa_file_util_; |
| 85 scoped_ptr<fileapi::AsyncFileUtil> itunes_file_util_; | 84 scoped_ptr<fileapi::AsyncFileUtil> itunes_file_util_; |
| 86 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 85 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 87 | 86 |
| 88 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemMountPointProvider); | 87 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemBackend); |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 } // namespace chrome | 90 } // namespace chrome |
| 92 | 91 |
| 93 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_MOUNT_POINT_
PROVIDER_H_ | 92 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ |
| OLD | NEW |