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 <string> | 8 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" |
9 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" | |
9 | 10 |
10 #include "base/files/file_path.h" | 11 class Profile; |
12 | |
13 namespace extensions { | |
14 class EventRouter; | |
15 } // namespace extensions | |
11 | 16 |
12 namespace chromeos { | 17 namespace chromeos { |
13 namespace file_system_provider { | 18 namespace file_system_provider { |
14 | 19 |
15 // Contains information about the provided file system instance. | 20 class RequestManager; |
16 class ProvidedFileSystem { | 21 |
22 // Provided file system implementation. Forwards requests between providers and | |
23 // clients. | |
24 class ProvidedFileSystem : public ProvidedFileSystemInterface { | |
17 public: | 25 public: |
18 ProvidedFileSystem(); | 26 ProvidedFileSystem(); |
19 ProvidedFileSystem(const std::string& extension_id, | 27 ProvidedFileSystem(extensions::EventRouter* event_router, |
20 int file_system_id, | 28 RequestManager* request_manager, |
21 const std::string& file_system_name, | 29 const ProvidedFileSystemInfo& file_system_info); |
22 const base::FilePath& mount_path); | 30 virtual ~ProvidedFileSystem(); |
23 | 31 |
24 ~ProvidedFileSystem(); | 32 // ProvidedFileSystemInterface overrides. |
25 | 33 virtual bool RequestUnmount( |
26 const std::string& extension_id() const { return extension_id_; } | 34 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; |
27 int file_system_id() const { return file_system_id_; } | 35 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; |
28 const std::string& file_system_name() const { return file_system_name_; } | |
29 const base::FilePath& mount_path() const { return mount_path_; } | |
30 | 36 |
31 private: | 37 private: |
32 // ID of the extension providing this file system. | 38 extensions::EventRouter* event_router_; |
33 std::string extension_id_; | 39 RequestManager* request_manager_; |
40 ProvidedFileSystemInfo file_system_info_; | |
34 | 41 |
35 // ID of the file system, used internally. | 42 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); |
36 int file_system_id_; | 43 }; |
37 | 44 |
38 // Name of the file system, can be rendered in the UI. | 45 // Factory creating provided file system instances. |
39 std::string file_system_name_; | 46 class ProvidedFileSystemFactory : public ProvidedFileSystemFactoryInterface { |
47 public: | |
48 ProvidedFileSystemFactory(); | |
49 virtual ~ProvidedFileSystemFactory(); | |
hashimoto
2014/04/11 06:01:50
Are these empty ctor and dtor needed?
mtomasz
2014/04/11 07:11:56
dtor yes, ctor seems redundant. I'll remove tmr.
P
mtomasz
2014/04/11 19:54:12
Opposite way. Dtor is redundant. Ctor is necessary
| |
40 | 50 |
41 // Mount path of the underlying file system. | 51 // ProvidedFileSystemFactoryInterface overrides. |
42 base::FilePath mount_path_; | 52 virtual ProvidedFileSystemInterface* Create( |
53 Profile* profile, | |
54 RequestManager* request_manager, | |
55 const ProvidedFileSystemInfo& file_system_info) OVERRIDE; | |
56 | |
57 private: | |
58 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystemFactory); | |
43 }; | 59 }; |
44 | 60 |
45 } // namespace file_system_provider | 61 } // namespace file_system_provider |
46 } // namespace chromeos | 62 } // namespace chromeos |
47 | 63 |
48 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ |
OLD | NEW |