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_INFO_H
_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H
_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H
_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H
_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "chrome/common/extensions/api/file_system_provider_capabilities/file_sy
stem_provider_capabilities_handler.h" |
11 | 12 |
12 namespace chromeos { | 13 namespace chromeos { |
13 namespace file_system_provider { | 14 namespace file_system_provider { |
14 | 15 |
15 // Options for creating the provided file system info. | 16 // Options for creating the provided file system info. |
16 struct MountOptions { | 17 struct MountOptions { |
17 MountOptions(); | 18 MountOptions(); |
18 | 19 |
19 // Only mandatory fields. | 20 // Only mandatory fields. |
20 MountOptions(const std::string& file_system_id, | 21 MountOptions(const std::string& file_system_id, |
21 const std::string& display_name); | 22 const std::string& display_name); |
22 | 23 |
23 std::string file_system_id; | 24 std::string file_system_id; |
24 std::string display_name; | 25 std::string display_name; |
25 bool writable; | 26 bool writable; |
26 bool supports_notify_tag; | 27 bool supports_notify_tag; |
27 int opened_files_limit; | 28 int opened_files_limit; |
28 }; | 29 }; |
29 | 30 |
30 // Contains information about the provided file system instance. | 31 // Contains information about the provided file system instance. |
31 class ProvidedFileSystemInfo { | 32 class ProvidedFileSystemInfo { |
32 public: | 33 public: |
33 ProvidedFileSystemInfo(); | 34 ProvidedFileSystemInfo(); |
34 | 35 |
35 ProvidedFileSystemInfo(const std::string& extension_id, | 36 ProvidedFileSystemInfo(const std::string& extension_id, |
36 const MountOptions& mount_options, | 37 const MountOptions& mount_options, |
37 const base::FilePath& mount_path); | 38 const base::FilePath& mount_path, |
| 39 bool configurable, |
| 40 extensions::FileSystemProviderSource source); |
38 | 41 |
39 ~ProvidedFileSystemInfo(); | 42 ~ProvidedFileSystemInfo(); |
40 | 43 |
41 const std::string& extension_id() const { return extension_id_; } | 44 const std::string& extension_id() const { return extension_id_; } |
42 const std::string& file_system_id() const { return file_system_id_; } | 45 const std::string& file_system_id() const { return file_system_id_; } |
43 const std::string& display_name() const { return display_name_; } | 46 const std::string& display_name() const { return display_name_; } |
44 bool writable() const { return writable_; } | 47 bool writable() const { return writable_; } |
45 bool supports_notify_tag() const { return supports_notify_tag_; } | 48 bool supports_notify_tag() const { return supports_notify_tag_; } |
46 int opened_files_limit() const { return opened_files_limit_; } | 49 int opened_files_limit() const { return opened_files_limit_; } |
47 const base::FilePath& mount_path() const { return mount_path_; } | 50 const base::FilePath& mount_path() const { return mount_path_; } |
| 51 const bool configurable() const { return configurable_; } |
| 52 extensions::FileSystemProviderSource source() const { return source_; } |
48 | 53 |
49 private: | 54 private: |
50 // ID of the extension providing this file system. | 55 // ID of the extension providing this file system. |
51 std::string extension_id_; | 56 std::string extension_id_; |
52 | 57 |
53 // ID of the file system. | 58 // ID of the file system. |
54 std::string file_system_id_; | 59 std::string file_system_id_; |
55 | 60 |
56 // Name of the file system, can be rendered in the UI. | 61 // Name of the file system, can be rendered in the UI. |
57 std::string display_name_; | 62 std::string display_name_; |
58 | 63 |
59 // Whether the file system is writable or just read-only. | 64 // Whether the file system is writable or just read-only. |
60 bool writable_; | 65 bool writable_; |
61 | 66 |
62 // Supports tags for file/directory change notifications. | 67 // Supports tags for file/directory change notifications. |
63 bool supports_notify_tag_; | 68 bool supports_notify_tag_; |
64 | 69 |
65 // Limit of opened files in parallel. If unlimited, then 0. | 70 // Limit of opened files in parallel. If unlimited, then 0. |
66 int opened_files_limit_; | 71 int opened_files_limit_; |
67 | 72 |
68 // Mount path of the underlying file system. | 73 // Mount path of the underlying file system. |
69 base::FilePath mount_path_; | 74 base::FilePath mount_path_; |
| 75 |
| 76 // Whether the file system is configurable. |
| 77 bool configurable_; |
| 78 |
| 79 // Source of the file system's data. |
| 80 extensions::FileSystemProviderSource source_; |
70 }; | 81 }; |
71 | 82 |
72 } // namespace file_system_provider | 83 } // namespace file_system_provider |
73 } // namespace chromeos | 84 } // namespace chromeos |
74 | 85 |
75 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INF
O_H_ | 86 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INF
O_H_ |
OLD | NEW |