| 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/chromeos/extensions/file_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 // We check permissions for raw cache file paths only for read-only | 1045 // We check permissions for raw cache file paths only for read-only |
| 1046 // operations (when fileEntry.file() is called), so read only permissions | 1046 // operations (when fileEntry.file() is called), so read only permissions |
| 1047 // should be sufficient for all cache paths. For the rest of supported | 1047 // should be sufficient for all cache paths. For the rest of supported |
| 1048 // operations the file access check is done for gdata/ paths. | 1048 // operations the file access check is done for gdata/ paths. |
| 1049 GrantFilePermissionsToHost(gdata_file_system->GetGDataCacheTmpDirectory(), | 1049 GrantFilePermissionsToHost(gdata_file_system->GetGDataCacheTmpDirectory(), |
| 1050 file_handler_util::GetReadOnlyPermissions()); | 1050 file_handler_util::GetReadOnlyPermissions()); |
| 1051 GrantFilePermissionsToHost( | 1051 GrantFilePermissionsToHost( |
| 1052 gdata_file_system->GetGDataCachePersistentDirectory(), | 1052 gdata_file_system->GetGDataCachePersistentDirectory(), |
| 1053 file_handler_util::GetReadOnlyPermissions()); | 1053 file_handler_util::GetReadOnlyPermissions()); |
| 1054 | 1054 |
| 1055 // Grant read-only permission for directory hosting temporary gdata document |
| 1056 // JSON files. |
| 1057 GrantFilePermissionsToHost(gdata_file_system->GetGDataTempDocumentDirectory(), |
| 1058 file_handler_util::GetReadOnlyPermissions()); |
| 1059 |
| 1055 provider->AddRemoteMountPoint( | 1060 provider->AddRemoteMountPoint( |
| 1056 mount_point, | 1061 mount_point, |
| 1057 new gdata::GDataFileSystemProxy(gdata_file_system)); | 1062 new gdata::GDataFileSystemProxy(gdata_file_system)); |
| 1058 | 1063 |
| 1059 FilePath mount_point_virtual; | 1064 FilePath mount_point_virtual; |
| 1060 if (provider->GetVirtualPath(mount_point, &mount_point_virtual)) | 1065 if (provider->GetVirtualPath(mount_point, &mount_point_virtual)) |
| 1061 provider->GrantFileAccessToExtension(extension_id(), mount_point_virtual); | 1066 provider->GrantFileAccessToExtension(extension_id(), mount_point_virtual); |
| 1062 } | 1067 } |
| 1063 | 1068 |
| 1064 void AddMountFunction::RaiseGDataMountEvent(gdata::GDataErrorCode error) { | 1069 void AddMountFunction::RaiseGDataMountEvent(gdata::GDataErrorCode error) { |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 local_source_file, | 1939 local_source_file, |
| 1935 remote_destination_file, | 1940 remote_destination_file, |
| 1936 base::Bind(&TransferFileFunction::OnTransferCompleted, | 1941 base::Bind(&TransferFileFunction::OnTransferCompleted, |
| 1937 this)); | 1942 this)); |
| 1938 } | 1943 } |
| 1939 | 1944 |
| 1940 void TransferFileFunction::OnTransferCompleted( | 1945 void TransferFileFunction::OnTransferCompleted( |
| 1941 base::PlatformFileError error) { | 1946 base::PlatformFileError error) { |
| 1942 SendResponse(error == base::PLATFORM_FILE_OK); | 1947 SendResponse(error == base::PLATFORM_FILE_OK); |
| 1943 } | 1948 } |
| OLD | NEW |