1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_MTP_FILE_SYSTEM_BACKEND_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_MTP_FILE_SYSTEM_BACKEND_DELEGATE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h"
17 class FileSystemContext
;
18 class FileStreamReader
;
20 class FileStreamWriter
;
22 } // namespace storage
24 class DeviceMediaAsyncFileUtil
;
28 // This is delegate interface to inject the MTP device file system in Chrome OS
30 class MTPFileSystemBackendDelegate
: public FileSystemBackendDelegate
{
32 explicit MTPFileSystemBackendDelegate(
33 const base::FilePath
& storage_partition_path
);
34 ~MTPFileSystemBackendDelegate() override
;
36 // FileSystemBackendDelegate overrides.
37 storage::AsyncFileUtil
* GetAsyncFileUtil(
38 storage::FileSystemType type
) override
;
39 scoped_ptr
<storage::FileStreamReader
> CreateFileStreamReader(
40 const storage::FileSystemURL
& url
,
42 int64 max_bytes_to_read
,
43 const base::Time
& expected_modification_time
,
44 storage::FileSystemContext
* context
) override
;
45 scoped_ptr
<storage::FileStreamWriter
> CreateFileStreamWriter(
46 const storage::FileSystemURL
& url
,
48 storage::FileSystemContext
* context
) override
;
49 storage::WatcherManager
* GetWatcherManager(
50 storage::FileSystemType type
) override
;
51 void GetRedirectURLForContents(const storage::FileSystemURL
& url
,
52 const storage::URLCallback
& callback
) override
;
55 scoped_ptr
<DeviceMediaAsyncFileUtil
> device_media_async_file_util_
;
57 DISALLOW_COPY_AND_ASSIGN(MTPFileSystemBackendDelegate
);
60 } // namespace chromeos
62 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_MTP_FILE_SYSTEM_BACKEND_DELEGATE_H_