Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4737)

Unified Diff: chrome/browser/chromeos/file_manager/fileapi_util.cc

Issue 1035523002: Merge: Be explicit about target type in platform_util::OpenItem() (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2311
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_manager/fileapi_util.cc
diff --git a/chrome/browser/chromeos/file_manager/fileapi_util.cc b/chrome/browser/chromeos/file_manager/fileapi_util.cc
index 8c8edef40f6fc21a689bd1977bbdc08ec1a2a70e..e7a1a4be4685a2347f3f1f4731e57f4ebde7a6d3 100644
--- a/chrome/browser/chromeos/file_manager/fileapi_util.cc
+++ b/chrome/browser/chromeos/file_manager/fileapi_util.cc
@@ -229,6 +229,18 @@ void CheckIfDirectoryExistsOnIOThread(
file_system_url, callback);
}
+// Used by GetMetadataForPath
+void GetMetadataOnIOThread(
+ scoped_refptr<storage::FileSystemContext> file_system_context,
+ const GURL& url,
+ const storage::FileSystemOperationRunner::GetMetadataCallback& callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ const storage::FileSystemURL file_system_url =
+ file_system_context->CrackURL(url);
+ file_system_context->operation_runner()->GetMetadata(file_system_url,
+ callback);
+}
+
// Checks if the |file_path| points non-native location or not.
bool IsUnderNonNativeLocalPath(const storage::FileSystemContext& context,
const base::FilePath& file_path) {
@@ -561,6 +573,23 @@ void CheckIfDirectoryExists(
google_apis::CreateRelayCallback(callback)));
}
+void GetMetadataForPath(
+ scoped_refptr<storage::FileSystemContext> file_system_context,
+ const GURL& url,
+ const storage::FileSystemOperationRunner::GetMetadataCallback& callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ storage::ExternalFileSystemBackend* const backend =
+ file_system_context->external_backend();
+ DCHECK(backend);
+ backend->GrantFullAccessToExtension(kFileManagerAppId);
+
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&GetMetadataOnIOThread, file_system_context, url,
+ google_apis::CreateRelayCallback(callback)));
+}
+
storage::FileSystemURL CreateIsolatedURLFromVirtualPath(
const storage::FileSystemContext& context,
const GURL& origin,
« no previous file with comments | « chrome/browser/chromeos/file_manager/fileapi_util.h ('k') | chrome/browser/chromeos/file_manager/open_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698