OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
6 #define WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | |
10 #include <string> | 9 #include <string> |
| 10 #include <vector> |
11 | 11 |
12 #include "webkit/fileapi/file_system_mount_point_provider.h" | 12 #include "webkit/fileapi/file_system_mount_point_provider.h" |
13 #include "webkit/quota/special_storage_policy.h" | 13 #include "webkit/quota/special_storage_policy.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 // An interface to provide local filesystem paths. | 17 // An interface to provide local filesystem paths. |
18 class CrosMountPointProvider | 18 class CrosMountPointProvider |
19 : public fileapi::FileSystemMountPointProvider { | 19 : public fileapi::FileSystemMountPointProvider { |
20 public: | 20 public: |
21 CrosMountPointProvider( | 21 CrosMountPointProvider( |
22 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); | 22 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); |
23 virtual ~CrosMountPointProvider(); | 23 virtual ~CrosMountPointProvider(); |
24 | 24 |
25 // fileapi::FileSystemMountPointProvider overrides. | 25 // fileapi::FileSystemMountPointProvider overrides. |
26 virtual bool IsAccessAllowed(const GURL& origin_url) OVERRIDE; | 26 virtual bool IsAccessAllowed(const GURL& origin_url, |
| 27 const FilePath& virtual_path) OVERRIDE; |
| 28 virtual void GrantAccess(const GURL& origin_url, |
| 29 const FilePath& virtual_path) OVERRIDE; |
27 | 30 |
28 virtual void GetFileSystemRootPath( | 31 virtual void GetFileSystemRootPath( |
29 const GURL& origin_url, | 32 const GURL& origin_url, |
30 fileapi::FileSystemType type, | 33 fileapi::FileSystemType type, |
31 bool create, | 34 bool create, |
32 fileapi::FileSystemPathManager::GetRootPathCallback* callback) OVERRIDE; | 35 fileapi::FileSystemPathManager::GetRootPathCallback* callback) OVERRIDE; |
33 | 36 |
34 virtual FilePath GetFileSystemRootPathOnFileThread( | 37 virtual FilePath GetFileSystemRootPathOnFileThread( |
35 const GURL& origin_url, | 38 const GURL& origin_url, |
36 fileapi::FileSystemType type, | 39 fileapi::FileSystemType type, |
37 const FilePath& virtual_path, | 40 const FilePath& virtual_path, |
38 bool create); | 41 bool create); |
39 | 42 |
40 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; | 43 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; |
41 | 44 |
| 45 virtual std::vector<FilePath> GetRootDirectories() const OVERRIDE; |
| 46 |
42 private: | 47 private: |
43 class GetFileSystemRootPathTask; | 48 class GetFileSystemRootPathTask; |
44 typedef std::map<std::string, std::string> MountPointMap; | 49 typedef std::map<std::string, std::string> MountPointMap; |
45 | 50 |
46 static const char kLocalDirName[]; | 51 static const char kLocalDirName[]; |
47 static const char kLocalName[]; | 52 static const char kLocalName[]; |
48 FilePath virtual_root_path_; | 53 FilePath virtual_root_path_; |
49 FilePath base_path_; | 54 FilePath base_path_; |
50 std::string local_dir_name_; | 55 std::string local_dir_name_; |
51 MountPointMap mount_point_map_; | 56 MountPointMap mount_point_map_; |
52 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 57 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
53 | 58 |
54 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); | 59 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); |
55 }; | 60 }; |
56 | 61 |
57 } // namespace chromeos | 62 } // namespace chromeos |
58 | 63 |
59 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 64 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |