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"
10 #include "chrome/browser/chromeos/fileapi/mtp_watcher_manager.h"
18 class FileSystemContext
;
19 class FileStreamReader
;
21 class FileStreamWriter
;
23 } // namespace storage
25 class DeviceMediaAsyncFileUtil
;
29 // This is delegate interface to inject the MTP device file system in Chrome OS
31 class MTPFileSystemBackendDelegate
: public FileSystemBackendDelegate
{
33 explicit MTPFileSystemBackendDelegate(
34 const base::FilePath
& storage_partition_path
);
35 ~MTPFileSystemBackendDelegate() override
;
37 // FileSystemBackendDelegate overrides.
38 storage::AsyncFileUtil
* GetAsyncFileUtil(
39 storage::FileSystemType type
) override
;
40 scoped_ptr
<storage::FileStreamReader
> CreateFileStreamReader(
41 const storage::FileSystemURL
& url
,
43 int64 max_bytes_to_read
,
44 const base::Time
& expected_modification_time
,
45 storage::FileSystemContext
* context
) override
;
46 scoped_ptr
<storage::FileStreamWriter
> CreateFileStreamWriter(
47 const storage::FileSystemURL
& url
,
49 storage::FileSystemContext
* context
) override
;
50 storage::WatcherManager
* GetWatcherManager(
51 storage::FileSystemType type
) override
;
52 void GetRedirectURLForContents(const storage::FileSystemURL
& url
,
53 const storage::URLCallback
& callback
) override
;
56 scoped_ptr
<DeviceMediaAsyncFileUtil
> device_media_async_file_util_
;
57 scoped_ptr
<MTPWatcherManager
> mtp_watcher_manager_
;
59 DISALLOW_COPY_AND_ASSIGN(MTPFileSystemBackendDelegate
);
62 } // namespace chromeos
64 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_MTP_FILE_SYSTEM_BACKEND_DELEGATE_H_