Chromium Code Reviews| 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 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 namespace file_system_provider { | 13 namespace file_system_provider { |
| 14 | 14 |
| 15 // Source of the file system's contents. | |
| 16 enum Source { SOURCE_FILE, SOURCE_DEVICE, SOURCE_NETWORK, SOURCE_UNKNOWN }; | |
|
hirono
2015/04/06 08:36:34
nit: How about putting SOURCE_UNKNOWN at first so
mtomasz
2015/04/06 09:13:48
I'm not really sure. I put the least expected one
hirono
2015/04/06 09:37:33
It's up to you. I don't have strong feeling about
| |
| 17 | |
| 15 // Options for creating the provided file system info. | 18 // Options for creating the provided file system info. |
| 16 struct MountOptions { | 19 struct MountOptions { |
| 17 MountOptions(); | 20 MountOptions(); |
| 18 | 21 |
| 19 // Only mandatory fields. | 22 // Only mandatory fields. |
| 20 MountOptions(const std::string& file_system_id, | 23 MountOptions(const std::string& file_system_id, |
| 21 const std::string& display_name); | 24 const std::string& display_name); |
| 22 | 25 |
| 23 std::string file_system_id; | 26 std::string file_system_id; |
| 24 std::string display_name; | 27 std::string display_name; |
| 25 bool writable; | 28 bool writable; |
| 29 Source source; | |
| 26 bool supports_notify_tag; | 30 bool supports_notify_tag; |
| 27 int opened_files_limit; | 31 int opened_files_limit; |
| 28 }; | 32 }; |
| 29 | 33 |
| 30 // Contains information about the provided file system instance. | 34 // Contains information about the provided file system instance. |
| 31 class ProvidedFileSystemInfo { | 35 class ProvidedFileSystemInfo { |
| 32 public: | 36 public: |
| 33 ProvidedFileSystemInfo(); | 37 ProvidedFileSystemInfo(); |
| 34 | 38 |
| 35 ProvidedFileSystemInfo(const std::string& extension_id, | 39 ProvidedFileSystemInfo(const std::string& extension_id, |
| 36 const MountOptions& mount_options, | 40 const MountOptions& mount_options, |
| 37 const base::FilePath& mount_path); | 41 const base::FilePath& mount_path); |
| 38 | 42 |
| 39 ~ProvidedFileSystemInfo(); | 43 ~ProvidedFileSystemInfo(); |
| 40 | 44 |
| 41 const std::string& extension_id() const { return extension_id_; } | 45 const std::string& extension_id() const { return extension_id_; } |
| 42 const std::string& file_system_id() const { return file_system_id_; } | 46 const std::string& file_system_id() const { return file_system_id_; } |
| 43 const std::string& display_name() const { return display_name_; } | 47 const std::string& display_name() const { return display_name_; } |
| 44 bool writable() const { return writable_; } | 48 bool writable() const { return writable_; } |
| 49 Source source() const { return source_; } | |
| 45 bool supports_notify_tag() const { return supports_notify_tag_; } | 50 bool supports_notify_tag() const { return supports_notify_tag_; } |
| 46 int opened_files_limit() const { return opened_files_limit_; } | 51 int opened_files_limit() const { return opened_files_limit_; } |
| 47 const base::FilePath& mount_path() const { return mount_path_; } | 52 const base::FilePath& mount_path() const { return mount_path_; } |
| 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 |
| 67 // Source of the file system's contents. By default SOURCE_UNKNOWN. | |
| 68 Source source_; | |
| 69 | |
| 62 // Supports tags for file/directory change notifications. | 70 // Supports tags for file/directory change notifications. |
| 63 bool supports_notify_tag_; | 71 bool supports_notify_tag_; |
| 64 | 72 |
| 65 // Limit of opened files in parallel. If unlimited, then 0. | 73 // Limit of opened files in parallel. If unlimited, then 0. |
| 66 int opened_files_limit_; | 74 int opened_files_limit_; |
| 67 | 75 |
| 68 // Mount path of the underlying file system. | 76 // Mount path of the underlying file system. |
| 69 base::FilePath mount_path_; | 77 base::FilePath mount_path_; |
| 70 }; | 78 }; |
| 71 | 79 |
| 72 } // namespace file_system_provider | 80 } // namespace file_system_provider |
| 73 } // namespace chromeos | 81 } // namespace chromeos |
| 74 | 82 |
| 75 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INF O_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INF O_H_ |
| OLD | NEW |