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. | |
| 146 // See: crbug.com/271946 | |
| 147 if (extension_id == "mppoamgbcpnkpacolchbacppkflagjbp" && | |
| 148 url.mount_type() == fileapi::kFileSystemTypeRestrictedNativeLocal) { | |
|
tbarzic
2013/08/14 23:18:10
does this actually work?
I think that url.mount_ty
mtomasz
2013/08/15 02:02:21
Oops! Good catch!
| |
| 149 return true; | |
| 150 } | |
| 151 | |
| 145 // Check first to make sure this extension has fileBrowserHander permissions. | 152 // Check first to make sure this extension has fileBrowserHander permissions. |
| 146 if (!special_storage_policy_->IsFileHandler(extension_id)) | 153 if (!special_storage_policy_->IsFileHandler(extension_id)) |
| 147 return false; | 154 return false; |
| 148 | 155 |
| 149 return file_access_permissions_->HasAccessPermission(extension_id, | 156 return file_access_permissions_->HasAccessPermission(extension_id, |
| 150 url.virtual_path()); | 157 url.virtual_path()); |
| 151 } | 158 } |
| 152 | 159 |
| 153 void FileSystemBackend::GrantFullAccessToExtension( | 160 void FileSystemBackend::GrantFullAccessToExtension( |
| 154 const std::string& extension_id) { | 161 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(); | 320 std::string mount_name = url.filesystem_id(); |
| 314 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && | 321 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && |
| 315 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { | 322 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { |
| 316 return base::FilePath(); | 323 return base::FilePath(); |
| 317 } | 324 } |
| 318 | 325 |
| 319 return root_path.DirName(); | 326 return root_path.DirName(); |
| 320 } | 327 } |
| 321 | 328 |
| 322 } // namespace chromeos | 329 } // namespace chromeos |
| OLD | NEW |