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

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

Issue 352393002: Be explicit about target type in platform_util::OpenItem() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk Created 5 years, 10 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 15550c52bedbbfc99beb321a9d7924c207e1c83e..da168b8b7bab508b1717684c6bc85d33e76b6130 100644
--- a/chrome/browser/chromeos/file_manager/fileapi_util.cc
+++ b/chrome/browser/chromeos/file_manager/fileapi_util.cc
@@ -229,6 +229,17 @@ 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);
+ storage::FileSystemURL file_system_url = file_system_context->CrackURL(url);
mtomasz 2015/03/06 07:05:49 nit: Can be const.
asanka 2015/03/06 21:09:40 Done.
+ 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) {
@@ -557,9 +568,24 @@ void CheckIfDirectoryExists(
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- base::Bind(&CheckIfDirectoryExistsOnIOThread,
- file_system_context,
- url,
+ base::Bind(&CheckIfDirectoryExistsOnIOThread, file_system_context, url,
+ 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* backend =
mtomasz 2015/03/06 07:05:49 nit: Can be const.
asanka 2015/03/06 21:09:40 The GrantFullAccessToExtension() call requires |ba
mtomasz 2015/03/07 00:01:12 I meant: storage::ExternalFileSystemBackend* const
asanka 2015/03/07 00:37:00 Ah. Got it and done.
+ 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)));
}

Powered by Google App Engine
This is Rietveld 408576698