| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 6 | 6 |
| 7 #include "apps/saved_files_service.h" | 7 #include "apps/saved_files_service.h" |
| 8 #include "apps/shell_window.h" | 8 #include "apps/shell_window.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 filesystem_path, | 205 filesystem_path, |
| 206 render_view_host, | 206 render_view_host, |
| 207 &filesystem_id, | 207 &filesystem_id, |
| 208 file_path, | 208 file_path, |
| 209 error); | 209 error); |
| 210 } | 210 } |
| 211 | 211 |
| 212 bool DoCheckWritableFile(const base::FilePath& path, | 212 bool DoCheckWritableFile(const base::FilePath& path, |
| 213 const base::FilePath& extension_directory) { | 213 const base::FilePath& extension_directory) { |
| 214 // Don't allow links. | 214 // Don't allow links. |
| 215 if (file_util::PathExists(path) && file_util::IsLink(path)) | 215 if (base::PathExists(path) && file_util::IsLink(path)) |
| 216 return false; | 216 return false; |
| 217 | 217 |
| 218 if (extension_directory == path || extension_directory.IsParent(path)) | 218 if (extension_directory == path || extension_directory.IsParent(path)) |
| 219 return false; | 219 return false; |
| 220 | 220 |
| 221 bool is_whitelisted_path = false; | 221 bool is_whitelisted_path = false; |
| 222 | 222 |
| 223 #if defined(OS_CHROMEOS) | 223 #if defined(OS_CHROMEOS) |
| 224 for (size_t i = 0; i < arraysize(kWhitelistedPaths); i++) { | 224 for (size_t i = 0; i < arraysize(kWhitelistedPaths); i++) { |
| 225 base::FilePath whitelisted_path; | 225 base::FilePath whitelisted_path; |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 // ID that was passed to restoreEntry. | 872 // ID that was passed to restoreEntry. |
| 873 RegisterFileSystemAndSendResponseWithIdOverride( | 873 RegisterFileSystemAndSendResponseWithIdOverride( |
| 874 file_entry->path, | 874 file_entry->path, |
| 875 file_entry->writable ? WRITABLE : READ_ONLY, | 875 file_entry->writable ? WRITABLE : READ_ONLY, |
| 876 file_entry->id); | 876 file_entry->id); |
| 877 } | 877 } |
| 878 return true; | 878 return true; |
| 879 } | 879 } |
| 880 | 880 |
| 881 } // namespace extensions | 881 } // namespace extensions |
| OLD | NEW |