OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" | 9 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info
.h" |
10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" | 10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte
rface.h" |
11 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" | 11 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" |
12 #include "webkit/browser/fileapi/async_file_util.h" | 12 #include "webkit/browser/fileapi/async_file_util.h" |
13 | 13 |
| 14 class Profile; |
| 15 |
14 namespace net { | 16 namespace net { |
15 class IOBuffer; | 17 class IOBuffer; |
16 } // namespace net | 18 } // namespace net |
17 | 19 |
18 namespace base { | 20 namespace base { |
19 class FilePath; | 21 class FilePath; |
20 } // namespace base | 22 } // namespace base |
21 | 23 |
22 namespace extensions { | 24 namespace extensions { |
23 class EventRouter; | 25 class EventRouter; |
24 } // namespace extensions | 26 } // namespace extensions |
25 | 27 |
26 namespace chromeos { | 28 namespace chromeos { |
27 namespace file_system_provider { | 29 namespace file_system_provider { |
28 | 30 |
| 31 class NotificationManagerInterface; |
| 32 |
29 // Provided file system implementation. Forwards requests between providers and | 33 // Provided file system implementation. Forwards requests between providers and |
30 // clients. | 34 // clients. |
31 class ProvidedFileSystem : public ProvidedFileSystemInterface { | 35 class ProvidedFileSystem : public ProvidedFileSystemInterface { |
32 public: | 36 public: |
33 ProvidedFileSystem(extensions::EventRouter* event_router, | 37 ProvidedFileSystem(Profile* profile, |
34 const ProvidedFileSystemInfo& file_system_info); | 38 const ProvidedFileSystemInfo& file_system_info); |
35 virtual ~ProvidedFileSystem(); | 39 virtual ~ProvidedFileSystem(); |
36 | 40 |
37 // ProvidedFileSystemInterface overrides. | 41 // ProvidedFileSystemInterface overrides. |
38 virtual void RequestUnmount( | 42 virtual void RequestUnmount( |
39 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 43 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
40 virtual void GetMetadata( | 44 virtual void GetMetadata( |
41 const base::FilePath& entry_path, | 45 const base::FilePath& entry_path, |
42 const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) OVERRIDE; | 46 const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) OVERRIDE; |
43 virtual void ReadDirectory( | 47 virtual void ReadDirectory( |
44 const base::FilePath& directory_path, | 48 const base::FilePath& directory_path, |
45 const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; | 49 const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; |
46 virtual void OpenFile(const base::FilePath& file_path, | 50 virtual void OpenFile(const base::FilePath& file_path, |
47 OpenFileMode mode, | 51 OpenFileMode mode, |
48 bool create, | 52 bool create, |
49 const OpenFileCallback& callback) OVERRIDE; | 53 const OpenFileCallback& callback) OVERRIDE; |
50 virtual void CloseFile( | 54 virtual void CloseFile( |
51 int file_handle, | 55 int file_handle, |
52 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; | 56 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
53 virtual void ReadFile(int file_handle, | 57 virtual void ReadFile(int file_handle, |
54 net::IOBuffer* buffer, | 58 net::IOBuffer* buffer, |
55 int64 offset, | 59 int64 offset, |
56 int length, | 60 int length, |
57 const ReadChunkReceivedCallback& callback) OVERRIDE; | 61 const ReadChunkReceivedCallback& callback) OVERRIDE; |
58 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; | 62 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; |
59 virtual RequestManager* GetRequestManager() OVERRIDE; | 63 virtual RequestManager* GetRequestManager() OVERRIDE; |
60 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; | 64 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; |
61 | 65 |
62 private: | 66 private: |
63 extensions::EventRouter* event_router_; | 67 Profile* profile_; // Not owned. |
| 68 extensions::EventRouter* event_router_; // Not owned. May be NULL. |
| 69 ProvidedFileSystemInfo file_system_info_; |
| 70 scoped_ptr<NotificationManagerInterface> notification_manager_; |
64 RequestManager request_manager_; | 71 RequestManager request_manager_; |
65 ProvidedFileSystemInfo file_system_info_; | |
66 | 72 |
67 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; | 73 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; |
68 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); | 74 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); |
69 }; | 75 }; |
70 | 76 |
71 } // namespace file_system_provider | 77 } // namespace file_system_provider |
72 } // namespace chromeos | 78 } // namespace chromeos |
73 | 79 |
74 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ | 80 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
OLD | NEW |