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

Unified Diff: chrome/browser/chromeos/fileapi/file_system_backend.cc

Issue 527773003: Add GetURLForBrowserTab method to the external file system backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 6 years, 3 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/fileapi/file_system_backend.cc
diff --git a/chrome/browser/chromeos/fileapi/file_system_backend.cc b/chrome/browser/chromeos/fileapi/file_system_backend.cc
index 5866c4721b5a1a21434032b0aee4e43190006240..9a60aab1689fc2bb256c52c97f6ffd8322818045 100644
--- a/chrome/browser/chromeos/fileapi/file_system_backend.cc
+++ b/chrome/browser/chromeos/fileapi/file_system_backend.cc
@@ -387,4 +387,33 @@ bool FileSystemBackend::GetVirtualPath(
system_mount_points_->GetVirtualPath(filesystem_path, virtual_path);
}
+void FileSystemBackend::GetRedirectURLForContents(
+ const storage::FileSystemURL& url,
+ const storage::URLCallback& callback) {
+ DCHECK(url.is_valid());
+
+ if (!IsAccessAllowed(url))
+ return callback.Run(GURL());
+
+ switch (url.type()) {
+ case storage::kFileSystemTypeDrive:
+ drive_delegate_->GetRedirectURLForContents(url, callback);
+ return;
+ case storage::kFileSystemTypeProvided:
+ file_system_provider_delegate_->GetRedirectURLForContents(url,
+ callback);
+ return;
+ case storage::kFileSystemTypeDeviceMediaAsFileStorage:
+ mtp_delegate_->GetRedirectURLForContents(url, callback);
+ return;
+ case storage::kFileSystemTypeNativeLocal:
+ case storage::kFileSystemTypeRestrictedNativeLocal:
+ callback.Run(GURL());
+ return;
+ default:
+ NOTREACHED();
+ }
+ callback.Run(GURL());
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/fileapi/file_system_backend.h ('k') | chrome/browser/chromeos/fileapi/file_system_backend_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698