Chromium Code Reviews| Index: apps/launcher.cc |
| diff --git a/apps/launcher.cc b/apps/launcher.cc |
| index 52c1328889d46c66fcaae4536f8c002aeb27c1b2..db756c2da922bdf1e880e5474c01c25caf2eec26 100644 |
| --- a/apps/launcher.cc |
| +++ b/apps/launcher.cc |
| @@ -38,9 +38,7 @@ |
| #include "url/gurl.h" |
| #if defined(OS_CHROMEOS) |
| -#include "chrome/browser/chromeos/drive/file_errors.h" |
| -#include "chrome/browser/chromeos/drive/file_system_interface.h" |
| -#include "chrome/browser/chromeos/drive/file_system_util.h" |
| +#include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" |
| #include "chrome/browser/chromeos/login/users/user_manager.h" |
| #endif |
| @@ -162,8 +160,11 @@ class PlatformAppPathLauncher |
| void OnFileValid() { |
| #if defined(OS_CHROMEOS) |
| - if (drive::util::IsUnderDriveMountPoint(file_path_)) { |
| - PlatformAppPathLauncher::GetMimeTypeAndLaunchForDriveFile(); |
| + if (file_manager::util::IsUnderSpecialPath(profile_, file_path_)) { |
| + file_manager::util::GetSpecialPathMimeType( |
| + profile_, |
| + file_path_, |
| + base::Bind(&PlatformAppPathLauncher::OnGotMimeType, this)); |
| return; |
| } |
| #endif |
| @@ -211,38 +212,13 @@ class PlatformAppPathLauncher |
| &PlatformAppPathLauncher::LaunchWithMimeType, this, mime_type)); |
| } |
| -#if defined(OS_CHROMEOS) |
| - void GetMimeTypeAndLaunchForDriveFile() { |
| - DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| - |
| - drive::FileSystemInterface* file_system = |
| - drive::util::GetFileSystemByProfile(profile_); |
| - if (!file_system) { |
| + void OnGotMimeType(bool success, const std::string& mime_type) { |
|
mtomasz
2014/05/26 05:54:15
nit: In app_file_handler_util.cc, chromeos-only me
benwells
2014/05/27 03:21:20
Let's #if it out.
kinaba
2014/05/27 05:39:28
Done.
|
| + if (!success) { |
| LaunchWithNoLaunchData(); |
| return; |
| } |
| - |
| - file_system->GetFile( |
| - drive::util::ExtractDrivePath(file_path_), |
| - base::Bind(&PlatformAppPathLauncher::OnGotDriveFile, this)); |
| - } |
| - |
| - void OnGotDriveFile(drive::FileError error, |
| - const base::FilePath& file_path, |
| - scoped_ptr<drive::ResourceEntry> entry) { |
| - DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| - |
| - if (error != drive::FILE_ERROR_OK || |
| - !entry || entry->file_specific_info().is_hosted_document()) { |
| - LaunchWithNoLaunchData(); |
| - return; |
| - } |
| - |
| - const std::string& mime_type = |
| - entry->file_specific_info().content_mime_type(); |
| LaunchWithMimeType(mime_type.empty() ? kFallbackMimeType : mime_type); |
| } |
| -#endif // defined(OS_CHROMEOS) |
| void LaunchWithNoLaunchData() { |
| // This method is required as an entry point on the UI thread. |