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 if (url.origin().scheme() == chrome::kDriveScheme) | 184 if (url.origin().scheme() == chrome::kExternalFileScheme) |
185 return true; | 185 return true; |
186 | 186 |
187 // Check first to make sure this extension has fileBrowserHander permissions. | 187 // Check first to make sure this extension has fileBrowserHander permissions. |
188 if (!special_storage_policy_.get() || | 188 if (!special_storage_policy_.get() || |
189 !special_storage_policy_->IsFileHandler(extension_id)) | 189 !special_storage_policy_->IsFileHandler(extension_id)) |
190 return false; | 190 return false; |
191 | 191 |
192 return file_access_permissions_->HasAccessPermission(extension_id, | 192 return file_access_permissions_->HasAccessPermission(extension_id, |
193 url.virtual_path()); | 193 url.virtual_path()); |
194 } | 194 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 case storage::kFileSystemTypeRestrictedNativeLocal: | 430 case storage::kFileSystemTypeRestrictedNativeLocal: |
431 callback.Run(GURL()); | 431 callback.Run(GURL()); |
432 return; | 432 return; |
433 default: | 433 default: |
434 NOTREACHED(); | 434 NOTREACHED(); |
435 } | 435 } |
436 callback.Run(GURL()); | 436 callback.Run(GURL()); |
437 } | 437 } |
438 | 438 |
439 } // namespace chromeos | 439 } // namespace chromeos |
OLD | NEW |