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

Unified Diff: chrome/browser/extensions/api/file_handlers/mime_util.cc

Issue 2666763005: API delegate for non-native file systems (Closed)
Patch Set: rebase Created 3 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/extensions/api/file_handlers/mime_util.cc
diff --git a/chrome/browser/extensions/api/file_handlers/mime_util.cc b/chrome/browser/extensions/api/file_handlers/mime_util.cc
index 1f3207bd0cc32b31e490fe9488e7d5fd44864977..82e3cf970259fe2f122a294e8e67dc8ee4fae103 100644
--- a/chrome/browser/extensions/api/file_handlers/mime_util.cc
+++ b/chrome/browser/extensions/api/file_handlers/mime_util.cc
@@ -16,7 +16,8 @@
#include "storage/browser/fileapi/file_system_url.h"
#if defined(OS_CHROMEOS)
-#include "chrome/browser/chromeos/file_manager/filesystem_api_util.h"
+#include "extensions/browser/api/extensions_api_client.h"
+#include "extensions/browser/api/file_handlers/non_native_file_system_delegate.h"
#endif
using content::BrowserThread;
@@ -133,11 +134,13 @@ void GetMimeTypeForLocalPath(
const base::FilePath& local_path,
const base::Callback<void(const std::string&)>& callback) {
#if defined(OS_CHROMEOS)
- if (file_manager::util::IsUnderNonNativeLocalPath(profile, local_path)) {
+ NonNativeFileSystemDelegate* delegate =
+ ExtensionsAPIClient::Get()->GetNonNativeFileSystemDelegate();
+ if (delegate && delegate->IsUnderNonNativeLocalPath(profile, local_path)) {
// For non-native files, try to get the MIME type from metadata. If not
// available, then try to guess from the extension. Never sniff (because
// it can be very slow).
- file_manager::util::GetNonNativeLocalPathMimeType(
+ delegate->GetNonNativeLocalPathMimeType(
profile,
local_path,
base::Bind(&OnGetMimeTypeFromMetadataForNonNativeLocalPathCompleted,

Powered by Google App Engine
This is Rietveld 408576698