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

Unified Diff: apps/launcher.cc

Issue 294163010: Refactor "IsUnderDriveMountPoint" in v2 app code for generalization to non-Drive volumes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename Created 6 years, 7 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
« no previous file with comments | « apps/DEPS ('k') | chrome/browser/chromeos/file_manager/filesystem_api_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/launcher.cc
diff --git a/apps/launcher.cc b/apps/launcher.cc
index 52c1328889d46c66fcaae4536f8c002aeb27c1b2..acaec4156a77cf2b3005a097fab7065cf4ec475b 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::IsUnderNonNativeLocalPath(profile_, file_path_)) {
+ file_manager::util::GetNonNativeLocalPathMimeType(
+ profile_,
+ file_path_,
+ base::Bind(&PlatformAppPathLauncher::OnGotMimeType, this));
return;
}
#endif
@@ -212,37 +213,14 @@ class PlatformAppPathLauncher
}
#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) {
+ 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)
+#endif
void LaunchWithNoLaunchData() {
// This method is required as an entry point on the UI thread.
« no previous file with comments | « apps/DEPS ('k') | chrome/browser/chromeos/file_manager/filesystem_api_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698