Chromium Code Reviews| Index: chrome/browser/extensions/platform_app_launcher.cc |
| diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc |
| index 2ad1d776afc7f36e46907c0d4df65efd9e71de8e..984b7e2a69c29f2734890947a708118afd5415cf 100644 |
| --- a/chrome/browser/extensions/platform_app_launcher.cc |
| +++ b/chrome/browser/extensions/platform_app_launcher.cc |
| @@ -56,6 +56,8 @@ namespace extensions { |
| namespace { |
| +const char kFallbackMimeType[] = "application/octet-stream"; |
| + |
| bool MakePathAbsolute(const base::FilePath& current_directory, |
| base::FilePath* file_path) { |
| DCHECK(file_path); |
| @@ -154,13 +156,8 @@ class PlatformAppPathLauncher |
| } |
| std::string mime_type; |
| - // If we cannot obtain the MIME type, launch with no launch data. |
| if (!net::GetMimeTypeFromFile(file_path_, &mime_type)) { |
|
koz (OOO until 15th September)
2013/04/16 04:56:18
nit: curlies are unnecessary now
Sam McNally
2013/04/16 05:17:33
Done.
|
| - LOG(WARNING) << "Could not obtain MIME type for " |
| - << file_path_.value(); |
| - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
| - &PlatformAppPathLauncher::LaunchWithNoLaunchData, this)); |
| - return; |
| + mime_type.assign(kFallbackMimeType); |
|
koz (OOO until 15th September)
2013/04/16 04:56:18
Is this different to
mime_type = kFallbackMimeTyp
Sam McNally
2013/04/16 05:17:33
No. Changed to assignment as it's probably clearer
|
| } |
| BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
| @@ -189,13 +186,16 @@ class PlatformAppPathLauncher |
| drive::DriveFileType file_type) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - if (error != drive::DRIVE_FILE_OK || mime_type.empty() || |
| - file_type != drive::REGULAR_FILE) { |
| + if (error != drive::DRIVE_FILE_OK || file_type != drive::REGULAR_FILE) { |
| LaunchWithNoLaunchData(); |
| return; |
| } |
| - LaunchWithMimeType(mime_type); |
| + if (mime_type.empty()) { |
|
koz (OOO until 15th September)
2013/04/16 04:56:18
nit: remove curlies
Sam McNally
2013/04/16 05:17:33
Done.
|
| + LaunchWithMimeType(kFallbackMimeType); |
|
koz (OOO until 15th September)
2013/04/16 04:56:18
nit: I think
LaunchWithMimeType(mime_type.empty()
Sam McNally
2013/04/16 05:17:33
Done.
|
| + } else { |
| + LaunchWithMimeType(mime_type); |
| + } |
| } |
| #endif // defined(OS_CHROMEOS) |