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/extensions/file_manager/private_api_mount.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_mount.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 volume->mount_path().IsParent(path)) { | 94 volume->mount_path().IsParent(path)) { |
95 is_under_downloads = true; | 95 is_under_downloads = true; |
96 break; | 96 break; |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 if (is_under_downloads) { | 100 if (is_under_downloads) { |
101 // For files under downloads, change the file permission and make it | 101 // For files under downloads, change the file permission and make it |
102 // readable from avfs/fuse if needed. | 102 // readable from avfs/fuse if needed. |
103 base::PostTaskWithTraits( | 103 base::PostTaskWithTraits( |
104 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 104 FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, |
105 base::TaskPriority::USER_BLOCKING), | |
106 base::Bind(&EnsureReadableFilePermissionAsync, path, | 105 base::Bind(&EnsureReadableFilePermissionAsync, path, |
107 google_apis::CreateRelayCallback( | 106 google_apis::CreateRelayCallback( |
108 base::Bind(&FileManagerPrivateAddMountFunction:: | 107 base::Bind(&FileManagerPrivateAddMountFunction:: |
109 RunAfterMarkCacheFileAsMounted, | 108 RunAfterMarkCacheFileAsMounted, |
110 this, path.BaseName())))); | 109 this, path.BaseName())))); |
111 } else { | 110 } else { |
112 RunAfterMarkCacheFileAsMounted( | 111 RunAfterMarkCacheFileAsMounted( |
113 path.BaseName(), drive::FILE_ERROR_OK, path); | 112 path.BaseName(), drive::FILE_ERROR_OK, path); |
114 } | 113 } |
115 } | 114 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 name(), request_id(), log_string.c_str(), result.size()); | 245 name(), request_id(), log_string.c_str(), result.size()); |
247 } | 246 } |
248 | 247 |
249 results_ = | 248 results_ = |
250 file_manager_private::GetVolumeMetadataList::Results::Create(result); | 249 file_manager_private::GetVolumeMetadataList::Results::Create(result); |
251 SendResponse(true); | 250 SendResponse(true); |
252 return true; | 251 return true; |
253 } | 252 } |
254 | 253 |
255 } // namespace extensions | 254 } // namespace extensions |
OLD | NEW |