Chromium Code Reviews| Index: chrome/browser/chromeos/file_manager/filesystem_api_util.cc |
| diff --git a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc |
| index c19fb7ecb9a740c233ee6cae328a83861e2384f0..9534dc2f4a5b13d384d15d571ad4202e518b36aa 100644 |
| --- a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc |
| +++ b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc |
| @@ -35,7 +35,8 @@ void GetMimeTypeAfterGetResourceEntryForDrive( |
| scoped_ptr<drive::ResourceEntry> entry) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| - if (error != drive::FILE_ERROR_OK || !entry->has_file_specific_info()) { |
| + if (error != drive::FILE_ERROR_OK || !entry->has_file_specific_info() || |
| + entry->file_specific_info().content_mime_type().empty()) { |
| callback.Run(false, std::string()); |
| return; |
| } |
| @@ -50,7 +51,7 @@ void GetMimeTypeAfterGetMetadataForProvidedFileSystem( |
| base::File::Error result) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| - if (result != base::File::FILE_OK) { |
| + if (result != base::File::FILE_OK || metadata->mime_type.empty()) { |
| callback.Run(false, std::string()); |
| return; |
| } |
| @@ -177,11 +178,13 @@ void GetNonNativeLocalPathMimeType( |
| return; |
| } |
| - // As a fallback just return success with an empty mime type value. |
| + // We don't have a way to obtain metadata other than drive and FSP. Returns an |
| + // error with empty mimetype, that leads fallback guessing mime type from file |
|
mtomasz
2014/09/26 08:21:00
nit: mimetype -> MIME type for consistency?
hirono
2014/09/26 08:33:42
Done.
|
| + // extensions. |
| content::BrowserThread::PostTask( |
| content::BrowserThread::UI, |
| FROM_HERE, |
| - base::Bind(callback, true /* success */, std::string())); |
| + base::Bind(callback, false /* failure */, std::string())); |
| } |
| void IsNonNativeLocalPathDirectory( |