OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const DeleteFileSystemCallback& callback) = 0; | 121 const DeleteFileSystemCallback& callback) = 0; |
122 }; | 122 }; |
123 | 123 |
124 // An interface to control external file system access permissions. | 124 // An interface to control external file system access permissions. |
125 class ExternalFileSystemMountPointProvider | 125 class ExternalFileSystemMountPointProvider |
126 : public FileSystemMountPointProvider { | 126 : public FileSystemMountPointProvider { |
127 public: | 127 public: |
128 // Returns the list of top level directories that are exposed by this | 128 // Returns the list of top level directories that are exposed by this |
129 // provider. This list is used to set appropriate child process file access | 129 // provider. This list is used to set appropriate child process file access |
130 // permissions. | 130 // permissions. |
131 virtual std::vector<FilePath> GetRootDirectories() const = 0; | 131 virtual std::vector<FilePath> GetRootDirectories( |
| 132 bool include_system_mount_points) const = 0; |
132 // Grants access to all external file system from extension identified with | 133 // Grants access to all external file system from extension identified with |
133 // |extension_id|. | 134 // |extension_id|. |
134 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; | 135 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; |
135 // Grants access to |virtual_path| from |origin_url|. | 136 // Grants access to |virtual_path| from |origin_url|. |
136 virtual void GrantFileAccessToExtension( | 137 virtual void GrantFileAccessToExtension( |
137 const std::string& extension_id, | 138 const std::string& extension_id, |
138 const FilePath& virtual_path) = 0; | 139 const FilePath& virtual_path) = 0; |
139 // Revokes file access from extension identified with |extension_id|. | 140 // Revokes file access from extension identified with |extension_id|. |
140 virtual void RevokeAccessForExtension( | 141 virtual void RevokeAccessForExtension( |
141 const std::string& extension_id) = 0; | 142 const std::string& extension_id) = 0; |
142 // Checks if a given |mount_point| already exists. | 143 // Checks if a given |mount_point| already exists. |
143 virtual bool HasMountPoint(const FilePath& mount_point) = 0; | 144 virtual bool HasMountPoint(const FilePath& mount_point) const = 0; |
144 // Adds a new local mount point. | 145 // Adds a new local mount point. |
145 virtual void AddLocalMountPoint(const FilePath& mount_point) = 0; | 146 virtual bool AddLocalMountPoint(const FilePath& mount_point) = 0; |
146 // Adds a new local mount point that will be accessible only by extensions | 147 // Adds a new local mount point that will be accessible only by extensions |
147 // that have been granted full acess for all external file systems. | 148 // that have been granted full acess for all external file systems. |
148 virtual void AddRestrictedLocalMountPoint(const FilePath& mount_point) = 0; | 149 virtual bool AddRestrictedLocalMountPoint(const FilePath& mount_point) = 0; |
149 // Adds a new remote mount point. | 150 // Adds a new remote mount point. |
150 virtual void AddRemoteMountPoint( | 151 virtual bool AddRemoteMountPoint( |
151 const FilePath& mount_point, | 152 const FilePath& mount_point, |
152 RemoteFileSystemProxyInterface* remote_proxy) = 0; | 153 RemoteFileSystemProxyInterface* remote_proxy) = 0; |
153 // Removes a mount point. | 154 // Removes a mount point. |
154 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; | 155 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; |
155 // Gets virtual path by known filesystem path. Returns false when filesystem | 156 // Gets virtual path by known filesystem path. Returns false when filesystem |
156 // path is not exposed by this provider. | 157 // path is not exposed by this provider. |
157 virtual bool GetVirtualPath(const FilePath& file_system_path, | 158 virtual bool GetVirtualPath(const FilePath& file_system_path, |
158 FilePath* virtual_path) = 0; | 159 FilePath* virtual_path) = 0; |
159 }; | 160 }; |
160 | 161 |
161 } // namespace fileapi | 162 } // namespace fileapi |
162 | 163 |
163 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 164 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |