Roll src/third_party/WebKit 8b42d1d:744641d (svn 186770:186771)
[chromium-blink-merge.git] / chrome / browser / chromeos / fileapi / mtp_file_system_backend_delegate.h
blobac6dd9ef656b9369f7e591fc1d27ee8d97e9f025
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"
11 namespace base {
12 class FilePath;
13 } // namespace base
15 namespace storage {
16 class AsyncFileUtil;
17 class FileSystemContext;
18 class FileStreamReader;
19 class FileSystemURL;
20 class FileStreamWriter;
21 class WatcherManager;
22 } // namespace storage
24 class DeviceMediaAsyncFileUtil;
26 namespace chromeos {
28 // This is delegate interface to inject the MTP device file system in Chrome OS
29 // file API backend.
30 class MTPFileSystemBackendDelegate : public FileSystemBackendDelegate {
31 public:
32 explicit MTPFileSystemBackendDelegate(
33 const base::FilePath& storage_partition_path);
34 virtual ~MTPFileSystemBackendDelegate();
36 // FileSystemBackendDelegate overrides.
37 virtual storage::AsyncFileUtil* GetAsyncFileUtil(
38 storage::FileSystemType type) override;
39 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader(
40 const storage::FileSystemURL& url,
41 int64 offset,
42 int64 max_bytes_to_read,
43 const base::Time& expected_modification_time,
44 storage::FileSystemContext* context) override;
45 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter(
46 const storage::FileSystemURL& url,
47 int64 offset,
48 storage::FileSystemContext* context) override;
49 virtual storage::WatcherManager* GetWatcherManager(
50 storage::FileSystemType type) override;
51 virtual void GetRedirectURLForContents(
52 const storage::FileSystemURL& url,
53 const storage::URLCallback& callback) override;
55 private:
56 scoped_ptr<DeviceMediaAsyncFileUtil> device_media_async_file_util_;
58 DISALLOW_COPY_AND_ASSIGN(MTPFileSystemBackendDelegate);
61 } // namespace chromeos
63 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_MTP_FILE_SYSTEM_BACKEND_DELEGATE_H_