Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: webkit/chromeos/fileapi/cros_mount_point_provider.h

Issue 6810037: File API changes needed for safely passing user selected file entities from the file browser comp... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/file_path.h"
12 #include "webkit/fileapi/file_system_mount_point_provider.h" 13 #include "webkit/fileapi/file_system_mount_point_provider.h"
13 #include "webkit/quota/special_storage_policy.h" 14 #include "webkit/quota/special_storage_policy.h"
14 15
15 namespace chromeos { 16 namespace chromeos {
16 17
18 class FileAccessPermissions;
19
17 // An interface to provide local filesystem paths. 20 // An interface to provide local filesystem paths.
18 class CrosMountPointProvider 21 class CrosMountPointProvider
19 : public fileapi::FileSystemMountPointProvider { 22 : public fileapi::ExternalFileSystemMountPointProvider {
20 public: 23 public:
21 CrosMountPointProvider( 24 CrosMountPointProvider(
22 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); 25 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy);
23 virtual ~CrosMountPointProvider(); 26 virtual ~CrosMountPointProvider();
24 27
25 // fileapi::FileSystemMountPointProvider overrides. 28 // fileapi::FileSystemMountPointProvider overrides.
26 virtual bool IsAccessAllowed(const GURL& origin_url) OVERRIDE; 29 virtual bool IsAccessAllowed(const GURL& origin_url,
27 30 const FilePath& virtual_path) OVERRIDE;
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
34 virtual FilePath GetFileSystemRootPathOnFileThread( 36 virtual FilePath GetFileSystemRootPathOnFileThread(
35 const GURL& origin_url, 37 const GURL& origin_url,
36 fileapi::FileSystemType type, 38 fileapi::FileSystemType type,
37 const FilePath& virtual_path, 39 const FilePath& virtual_path,
38 bool create); 40 bool create);
41 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
42 virtual std::vector<FilePath> GetRootDirectories() const OVERRIDE;
39 43
40 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; 44 // fileapi::ExternalFileSystemMountPointProvider overrides.
45 virtual void GrantFullAccessToExtension(
46 const std::string& extension_id) OVERRIDE;
47 virtual void GrantFileAccessToExtension(
48 const std::string& extension_id, const FilePath& virtual_path) OVERRIDE;
49 void RevokeAccessForExtension(const std::string& extension_id) OVERRIDE;
41 50
42 private: 51 private:
43 class GetFileSystemRootPathTask; 52 class GetFileSystemRootPathTask;
44 typedef std::map<std::string, std::string> MountPointMap; 53 typedef std::map<std::string, FilePath> MountPointMap;
45 54
46 static const char kLocalDirName[]; 55 static const char kExternalName[];
47 static const char kLocalName[]; 56
48 FilePath virtual_root_path_;
49 FilePath base_path_;
50 std::string local_dir_name_;
51 MountPointMap mount_point_map_; 57 MountPointMap mount_point_map_;
52 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; 58 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
53 59 scoped_ptr<FileAccessPermissions> file_access_permissions_;
54 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); 60 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider);
55 }; 61 };
56 62
57 } // namespace chromeos 63 } // namespace chromeos
58 64
59 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ 65 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698