Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / file_system_provider / provided_file_system_info.h
blob677e8397076a6abe5591600b9676858243143e7b
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
3 // found in the LICENSE file.
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_
8 #include <string>
10 #include "base/files/file_path.h"
11 #include "chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h"
13 namespace chromeos {
14 namespace file_system_provider {
16 // Options for creating the provided file system info.
17 struct MountOptions {
18 MountOptions();
20 // Only mandatory fields.
21 MountOptions(const std::string& file_system_id,
22 const std::string& display_name);
24 std::string file_system_id;
25 std::string display_name;
26 bool writable;
27 bool supports_notify_tag;
28 int opened_files_limit;
31 // Contains information about the provided file system instance.
32 class ProvidedFileSystemInfo {
33 public:
34 ProvidedFileSystemInfo();
36 ProvidedFileSystemInfo(const std::string& extension_id,
37 const MountOptions& mount_options,
38 const base::FilePath& mount_path,
39 bool configurable,
40 bool watchable,
41 extensions::FileSystemProviderSource source);
43 ~ProvidedFileSystemInfo();
45 const std::string& extension_id() const { return extension_id_; }
46 const std::string& file_system_id() const { return file_system_id_; }
47 const std::string& display_name() const { return display_name_; }
48 bool writable() const { return writable_; }
49 bool supports_notify_tag() const { return supports_notify_tag_; }
50 int opened_files_limit() const { return opened_files_limit_; }
51 const base::FilePath& mount_path() const { return mount_path_; }
52 const bool configurable() const { return configurable_; }
53 const bool watchable() const { return watchable_; }
54 extensions::FileSystemProviderSource source() const { return source_; }
56 private:
57 // ID of the extension providing this file system.
58 std::string extension_id_;
60 // ID of the file system.
61 std::string file_system_id_;
63 // Name of the file system, can be rendered in the UI.
64 std::string display_name_;
66 // Whether the file system is writable or just read-only.
67 bool writable_;
69 // Supports tags for file/directory change notifications.
70 bool supports_notify_tag_;
72 // Limit of opened files in parallel. If unlimited, then 0.
73 int opened_files_limit_;
75 // Mount path of the underlying file system.
76 base::FilePath mount_path_;
78 // Whether the file system is configurable.
79 bool configurable_;
81 // Whether the file system is watchable.
82 bool watchable_;
84 // Source of the file system's data.
85 extensions::FileSystemProviderSource source_;
88 } // namespace file_system_provider
89 } // namespace chromeos
91 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H_