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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const FileSystemFactoryCallback& factory_callback); | 75 const FileSystemFactoryCallback& factory_callback); |
76 | 76 |
77 // Sets a custom Registry implementation. Used by unit tests. | 77 // Sets a custom Registry implementation. Used by unit tests. |
78 void SetRegistryForTesting(scoped_ptr<RegistryInterface> registry); | 78 void SetRegistryForTesting(scoped_ptr<RegistryInterface> registry); |
79 | 79 |
80 // Mounts a file system provided by an extension with the |extension_id|. If | 80 // Mounts a file system provided by an extension with the |extension_id|. If |
81 // |writable| is set to true, then the file system is mounted in a R/W mode. | 81 // |writable| is set to true, then the file system is mounted in a R/W mode. |
82 // Otherwise, only read-only operations are supported. If change notification | 82 // Otherwise, only read-only operations are supported. If change notification |
83 // tags are supported, then |supports_notify_tag| must be true. Note, that | 83 // tags are supported, then |supports_notify_tag| must be true. Note, that |
84 // it is required in order to enable the internal cache. For success, returns | 84 // it is required in order to enable the internal cache. For success, returns |
85 // true, otherwise false. | 85 // base::File::FILE_OK, otherwise an error code. |
86 bool MountFileSystem(const std::string& extension_id, | 86 base::File::Error MountFileSystem(const std::string& extension_id, |
87 const MountOptions& options); | 87 const MountOptions& options); |
88 | 88 |
89 // Unmounts a file system with the specified |file_system_id| for the | 89 // Unmounts a file system with the specified |file_system_id| for the |
90 // |extension_id|. For success returns true, otherwise false. | 90 // |extension_id|. For success returns base::File::FILE_OK, otherwise an error |
91 bool UnmountFileSystem(const std::string& extension_id, | 91 // code. |
92 const std::string& file_system_id, | 92 base::File::Error UnmountFileSystem(const std::string& extension_id, |
93 UnmountReason reason); | 93 const std::string& file_system_id, |
| 94 UnmountReason reason); |
94 | 95 |
95 // Requests unmounting of the file system. The callback is called when the | 96 // Requests unmounting of the file system. The callback is called when the |
96 // request is accepted or rejected, with an error code. Returns false if the | 97 // request is accepted or rejected, with an error code. Returns false if the |
97 // request could not been created, true otherwise. | 98 // request could not been created, true otherwise. |
98 bool RequestUnmount(const std::string& extension_id, | 99 bool RequestUnmount(const std::string& extension_id, |
99 const std::string& file_system_id); | 100 const std::string& file_system_id); |
100 | 101 |
101 // Returns a list of information of all currently provided file systems. All | 102 // Returns a list of information of all currently provided file systems. All |
102 // items are copied. | 103 // items are copied. |
103 std::vector<ProvidedFileSystemInfo> GetProvidedFileSystemInfoList(); | 104 std::vector<ProvidedFileSystemInfo> GetProvidedFileSystemInfoList(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 base::ThreadChecker thread_checker_; | 184 base::ThreadChecker thread_checker_; |
184 | 185 |
185 base::WeakPtrFactory<Service> weak_ptr_factory_; | 186 base::WeakPtrFactory<Service> weak_ptr_factory_; |
186 DISALLOW_COPY_AND_ASSIGN(Service); | 187 DISALLOW_COPY_AND_ASSIGN(Service); |
187 }; | 188 }; |
188 | 189 |
189 } // namespace file_system_provider | 190 } // namespace file_system_provider |
190 } // namespace chromeos | 191 } // namespace chromeos |
191 | 192 |
192 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 193 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
OLD | NEW |