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