OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | |
kinaba
2014/09/04 04:17:04
callback_forward.h
hirono
2014/09/04 04:29:09
Done.
| |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "webkit/common/fileapi/file_system_types.h" | 11 #include "webkit/common/fileapi/file_system_types.h" |
11 | 12 |
13 class GURL; | |
14 | |
12 namespace base { | 15 namespace base { |
13 class Time; | 16 class Time; |
14 } // namespace base | 17 } // namespace base |
15 | 18 |
16 namespace storage { | 19 namespace storage { |
17 class AsyncFileUtil; | 20 class AsyncFileUtil; |
18 class FileSystemContext; | 21 class FileSystemContext; |
19 class FileStreamReader; | 22 class FileStreamReader; |
20 class FileSystemURL; | 23 class FileSystemURL; |
21 class FileStreamWriter; | 24 class FileStreamWriter; |
22 class WatcherManager; | 25 class WatcherManager; |
23 } // namespace storage | 26 } // namespace storage |
24 | 27 |
25 namespace storage { | 28 namespace storage { |
26 class FileStreamReader; | 29 class FileStreamReader; |
27 } // namespace storage | 30 } // namespace storage |
28 | 31 |
29 namespace chromeos { | 32 namespace chromeos { |
30 | 33 |
31 // This is delegate interface to inject the implementation of the some methods | 34 // This is delegate interface to inject the implementation of the some methods |
32 // of FileSystemBackend. | 35 // of FileSystemBackend. |
33 class FileSystemBackendDelegate { | 36 class FileSystemBackendDelegate { |
34 public: | 37 public: |
38 typedef base::Callback<void(const GURL&)> URLCallback; | |
39 | |
35 virtual ~FileSystemBackendDelegate() {} | 40 virtual ~FileSystemBackendDelegate() {} |
36 | 41 |
37 // Called from FileSystemBackend::GetAsyncFileUtil(). | 42 // Called from FileSystemBackend::GetAsyncFileUtil(). |
38 virtual storage::AsyncFileUtil* GetAsyncFileUtil( | 43 virtual storage::AsyncFileUtil* GetAsyncFileUtil( |
39 storage::FileSystemType type) = 0; | 44 storage::FileSystemType type) = 0; |
40 | 45 |
41 // Called from FileSystemBackend::CreateFileStreamReader(). | 46 // Called from FileSystemBackend::CreateFileStreamReader(). |
42 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 47 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
43 const storage::FileSystemURL& url, | 48 const storage::FileSystemURL& url, |
44 int64 offset, | 49 int64 offset, |
45 const base::Time& expected_modification_time, | 50 const base::Time& expected_modification_time, |
46 storage::FileSystemContext* context) = 0; | 51 storage::FileSystemContext* context) = 0; |
47 | 52 |
48 // Called from FileSystemBackend::CreateFileStreamWriter(). | 53 // Called from FileSystemBackend::CreateFileStreamWriter(). |
49 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( | 54 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( |
50 const storage::FileSystemURL& url, | 55 const storage::FileSystemURL& url, |
51 int64 offset, | 56 int64 offset, |
52 storage::FileSystemContext* context) = 0; | 57 storage::FileSystemContext* context) = 0; |
53 | 58 |
54 // Called from the FileSystemWatcherService class. The returned pointer must | 59 // Called from the FileSystemWatcherService class. The returned pointer must |
55 // stay valid until shutdown. | 60 // stay valid until shutdown. |
56 virtual storage::WatcherManager* GetWatcherManager( | 61 virtual storage::WatcherManager* GetWatcherManager( |
57 const storage::FileSystemURL& url) = 0; | 62 const storage::FileSystemURL& url) = 0; |
63 | |
64 // Called from FileSystemBackend::GetURLForBrowserTab. | |
65 virtual void GetURLForBrowserTab( | |
66 const storage::FileSystemURL& url, | |
67 const URLCallback& callback) = 0; | |
58 }; | 68 }; |
59 | 69 |
60 } // namespace chromeos | 70 } // namespace chromeos |
61 | 71 |
62 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 72 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
OLD | NEW |