| 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/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" | 10 #include "chrome/browser/chromeos/fileapi/file_access_permissions.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return false; | 174 return false; |
| 175 | 175 |
| 176 std::string extension_id = url.origin().host(); | 176 std::string extension_id = url.origin().host(); |
| 177 // TODO(mtomasz): Temporarily whitelist TimeScapes. Remove this in M-31. | 177 // TODO(mtomasz): Temporarily whitelist TimeScapes. Remove this in M-31. |
| 178 // See: crbug.com/271946 | 178 // See: crbug.com/271946 |
| 179 if (extension_id == "mlbmkoenclnokonejhlfakkeabdlmpek" && | 179 if (extension_id == "mlbmkoenclnokonejhlfakkeabdlmpek" && |
| 180 url.type() == storage::kFileSystemTypeRestrictedNativeLocal) { | 180 url.type() == storage::kFileSystemTypeRestrictedNativeLocal) { |
| 181 return true; | 181 return true; |
| 182 } | 182 } |
| 183 | 183 |
| 184 // Grant access for URL having "externalfile:" scheme. The URL | |
| 185 // filesystem:externalfile:/xxx cannot be parsed directly. The URL is created | |
| 186 // only by DriveURLRequestJob. | |
| 187 if (url.origin().scheme() == chrome::kExternalFileScheme) | |
| 188 return true; | |
| 189 | |
| 190 // Check first to make sure this extension has fileBrowserHander permissions. | 184 // Check first to make sure this extension has fileBrowserHander permissions. |
| 191 if (!special_storage_policy_.get() || | 185 if (!special_storage_policy_.get() || |
| 192 !special_storage_policy_->IsFileHandler(extension_id)) | 186 !special_storage_policy_->IsFileHandler(extension_id)) |
| 193 return false; | 187 return false; |
| 194 | 188 |
| 195 return file_access_permissions_->HasAccessPermission(extension_id, | 189 return file_access_permissions_->HasAccessPermission(extension_id, |
| 196 url.virtual_path()); | 190 url.virtual_path()); |
| 197 } | 191 } |
| 198 | 192 |
| 199 void FileSystemBackend::GrantFullAccessToExtension( | 193 void FileSystemBackend::GrantFullAccessToExtension( |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 case storage::kFileSystemTypeRestrictedNativeLocal: | 427 case storage::kFileSystemTypeRestrictedNativeLocal: |
| 434 callback.Run(GURL()); | 428 callback.Run(GURL()); |
| 435 return; | 429 return; |
| 436 default: | 430 default: |
| 437 NOTREACHED(); | 431 NOTREACHED(); |
| 438 } | 432 } |
| 439 callback.Run(GURL()); | 433 callback.Run(GURL()); |
| 440 } | 434 } |
| 441 | 435 |
| 442 } // namespace chromeos | 436 } // namespace chromeos |
| OLD | NEW |