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 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" | 5 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_callback_factory.h" | 8 #include "base/memory/scoped_callback_factory.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 return FilePath(iter->second); | 111 return FilePath(iter->second); |
112 } | 112 } |
113 | 113 |
114 // TODO(zelidrag): Share this code with SandboxMountPointProvider impl. | 114 // TODO(zelidrag): Share this code with SandboxMountPointProvider impl. |
115 bool CrosMountPointProvider::IsRestrictedFileName(const FilePath& path) const { | 115 bool CrosMountPointProvider::IsRestrictedFileName(const FilePath& path) const { |
116 return false; | 116 return false; |
117 } | 117 } |
118 | 118 |
119 bool CrosMountPointProvider::IsAccessAllowed(const GURL& origin_url) { | 119 bool CrosMountPointProvider::IsAccessAllowed(const GURL& origin_url, |
120 return special_storage_policy_->IsLocalFileSystemAccessAllowed(origin_url); | 120 const FilePath& virtual_path) { |
| 121 return special_storage_policy_->IsLocalFileSystemAccessAllowed(origin_url, |
| 122 virtual_path); |
| 123 } |
| 124 |
| 125 void CrosMountPointProvider::GrantAccess(const GURL& origin_url, |
| 126 const FilePath& virtual_path) { |
| 127 special_storage_policy_->GrantLocalFileSystemAccess(origin_url, virtual_path); |
| 128 } |
| 129 |
| 130 std::vector<FilePath> CrosMountPointProvider::GetRootDirectories() const { |
| 131 std::vector<FilePath> root_dirs; |
| 132 for (MountPointMap::const_iterator iter = mount_point_map_.begin(); |
| 133 iter != mount_point_map_.end(); |
| 134 ++iter) { |
| 135 FilePath path(iter->second); |
| 136 root_dirs.push_back(path.Append(iter->first)); |
| 137 } |
| 138 return root_dirs; |
121 } | 139 } |
122 | 140 |
123 } // namespace chromeos | 141 } // namespace chromeos |
124 | 142 |
OLD | NEW |