| 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 "webkit/browser/fileapi/file_system_context.h" | 5 #include "webkit/browser/fileapi/file_system_context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 case kFileSystemTypeDrive: | 70 case kFileSystemTypeDrive: |
| 71 case kFileSystemTypeNativeForPlatformApp: | 71 case kFileSystemTypeNativeForPlatformApp: |
| 72 case kFileSystemTypeNativeLocal: | 72 case kFileSystemTypeNativeLocal: |
| 73 case kFileSystemTypeCloudDevice: | 73 case kFileSystemTypeCloudDevice: |
| 74 return FILE_PERMISSION_USE_FILE_PERMISSION; | 74 return FILE_PERMISSION_USE_FILE_PERMISSION; |
| 75 | 75 |
| 76 case kFileSystemTypeRestrictedNativeLocal: | 76 case kFileSystemTypeRestrictedNativeLocal: |
| 77 return FILE_PERMISSION_READ_ONLY | | 77 return FILE_PERMISSION_READ_ONLY | |
| 78 FILE_PERMISSION_USE_FILE_PERMISSION; | 78 FILE_PERMISSION_USE_FILE_PERMISSION; |
| 79 | 79 |
| 80 // Following types are only accessed via IsolatedFileSystem, and | |
| 81 // don't have their own permission policies. | |
| 82 case kFileSystemTypeDeviceMedia: | 80 case kFileSystemTypeDeviceMedia: |
| 83 case kFileSystemTypeDragged: | |
| 84 case kFileSystemTypeForTransientFile: | |
| 85 case kFileSystemTypeIphoto: | 81 case kFileSystemTypeIphoto: |
| 86 case kFileSystemTypeItunes: | 82 case kFileSystemTypeItunes: |
| 87 case kFileSystemTypeNativeMedia: | 83 case kFileSystemTypeNativeMedia: |
| 88 case kFileSystemTypePicasa: | 84 case kFileSystemTypePicasa: |
| 85 return FILE_PERMISSION_USE_FILE_PERMISSION; |
| 86 |
| 87 // Following types are only accessed via IsolatedFileSystem, and |
| 88 // don't have their own permission policies. |
| 89 case kFileSystemTypeDragged: |
| 90 case kFileSystemTypeForTransientFile: |
| 89 case kFileSystemTypePluginPrivate: | 91 case kFileSystemTypePluginPrivate: |
| 90 return FILE_PERMISSION_ALWAYS_DENY; | 92 return FILE_PERMISSION_ALWAYS_DENY; |
| 91 | 93 |
| 92 // Following types only appear as mount_type, and will not be | 94 // Following types only appear as mount_type, and will not be |
| 93 // queried for their permission policies. | 95 // queried for their permission policies. |
| 94 case kFileSystemTypeIsolated: | 96 case kFileSystemTypeIsolated: |
| 95 case kFileSystemTypeExternal: | 97 case kFileSystemTypeExternal: |
| 96 return FILE_PERMISSION_ALWAYS_DENY; | 98 return FILE_PERMISSION_ALWAYS_DENY; |
| 97 | 99 |
| 98 // Following types should not be used to access files by FileAPI clients. | 100 // Following types should not be used to access files by FileAPI clients. |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 } else if (parent != child) { | 576 } else if (parent != child) { |
| 575 bool result = parent.AppendRelativePath(child, &path); | 577 bool result = parent.AppendRelativePath(child, &path); |
| 576 DCHECK(result); | 578 DCHECK(result); |
| 577 } | 579 } |
| 578 | 580 |
| 579 operation_runner()->GetMetadata( | 581 operation_runner()->GetMetadata( |
| 580 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); | 582 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); |
| 581 } | 583 } |
| 582 | 584 |
| 583 } // namespace fileapi | 585 } // namespace fileapi |
| OLD | NEW |