Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / file_system_provider / fileapi / backend_delegate.h
blobf7bcd0fb03598fb5429c9c3f2d969de94c71c13b
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_FILE_SYSTEM_PROVIDER_FILEAPI_BACKEND_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_BACKEND_DELEGATE_H_
8 #include "base/basictypes.h"
9 #include "base/files/file_util.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h"
13 namespace storage {
14 class AsyncFileUtil;
15 class FileSystemContext;
16 class FileStreamReader;
17 class FileSystemURL;
18 class FileStreamWriter;
19 class WatcherManager;
20 } // namespace storage
22 namespace chromeos {
23 namespace file_system_provider {
25 // Delegate implementation of the some methods in chromeos::FileSystemBackend
26 // for provided file systems.
27 class BackendDelegate : public chromeos::FileSystemBackendDelegate {
28 public:
29 BackendDelegate();
30 ~BackendDelegate() override;
32 // FileSystemBackend::Delegate overrides.
33 storage::AsyncFileUtil* GetAsyncFileUtil(
34 storage::FileSystemType type) override;
35 scoped_ptr<storage::FileStreamReader> CreateFileStreamReader(
36 const storage::FileSystemURL& url,
37 int64 offset,
38 int64 max_bytes_to_read,
39 const base::Time& expected_modification_time,
40 storage::FileSystemContext* context) override;
41 scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter(
42 const storage::FileSystemURL& url,
43 int64 offset,
44 storage::FileSystemContext* context) override;
45 storage::WatcherManager* GetWatcherManager(
46 storage::FileSystemType type) override;
47 void GetRedirectURLForContents(const storage::FileSystemURL& url,
48 const storage::URLCallback& callback) override;
50 private:
51 scoped_ptr<storage::AsyncFileUtil> async_file_util_;
52 scoped_ptr<storage::WatcherManager> watcher_manager_;
54 DISALLOW_COPY_AND_ASSIGN(BackendDelegate);
57 } // namespace file_system_provider
58 } // namespace chromeos
60 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_BACKEND_DELEGATE_H_