Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/fileapi/file_system_backend.h" | 5 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 return true; | 135 return true; |
| 136 | 136 |
| 137 // No extra check is needed for isolated file systems. | 137 // No extra check is needed for isolated file systems. |
| 138 if (url.mount_type() == fileapi::kFileSystemTypeIsolated) | 138 if (url.mount_type() == fileapi::kFileSystemTypeIsolated) |
| 139 return true; | 139 return true; |
| 140 | 140 |
| 141 if (!CanHandleURL(url)) | 141 if (!CanHandleURL(url)) |
| 142 return false; | 142 return false; |
| 143 | 143 |
| 144 std::string extension_id = origin_url.host(); | 144 std::string extension_id = origin_url.host(); |
| 145 // TODO(mtomasz): Temporarily whitelist TimeScapes. Remove this in M-31. | |
|
satorux1
2013/08/13 04:39:21
Please file a bug and add a URL for it.
mtomasz
2013/08/13 05:35:25
Done.
| |
| 146 if (extension_id == "mppoamgbcpnkpacolchbacppkflagjbp" && | |
| 147 url.mount_type() == fileapi::kFileSystemTypeRestrictedNativeLocal) { | |
| 148 return true; | |
| 149 } | |
| 150 | |
| 145 // Check first to make sure this extension has fileBrowserHander permissions. | 151 // Check first to make sure this extension has fileBrowserHander permissions. |
| 146 if (!special_storage_policy_->IsFileHandler(extension_id)) | 152 if (!special_storage_policy_->IsFileHandler(extension_id)) |
| 147 return false; | 153 return false; |
| 148 | 154 |
| 149 return file_access_permissions_->HasAccessPermission(extension_id, | 155 return file_access_permissions_->HasAccessPermission(extension_id, |
| 150 url.virtual_path()); | 156 url.virtual_path()); |
| 151 } | 157 } |
| 152 | 158 |
| 153 void FileSystemBackend::GrantFullAccessToExtension( | 159 void FileSystemBackend::GrantFullAccessToExtension( |
| 154 const std::string& extension_id) { | 160 const std::string& extension_id) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 std::string mount_name = url.filesystem_id(); | 319 std::string mount_name = url.filesystem_id(); |
| 314 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && | 320 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && |
| 315 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { | 321 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { |
| 316 return base::FilePath(); | 322 return base::FilePath(); |
| 317 } | 323 } |
| 318 | 324 |
| 319 return root_path.DirName(); | 325 return root_path.DirName(); |
| 320 } | 326 } |
| 321 | 327 |
| 322 } // namespace chromeos | 328 } // namespace chromeos |
| OLD | NEW |