Index: chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc |
diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc |
index 04d54afd16e6a0ab5ed947f584eae2141b5af4ef..9c921175175a5d209178f6d98e4e01d28382b7da 100644 |
--- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc |
+++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc |
@@ -18,7 +18,7 @@ |
#include "webkit/common/fileapi/file_system_types.h" |
#if defined(OS_CHROMEOS) |
-#include "chrome/browser/chromeos/drive/file_system_util.h" |
+#include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" |
#endif |
using apps::file_handler_util::GrantedFileEntry; |
@@ -116,11 +116,7 @@ class WritableFileChecker |
void CheckLocalWritableFiles(); |
#if defined(OS_CHROMEOS) |
- void CheckRemoteWritableFile(const base::FilePath& remote_path, |
- drive::FileError error, |
- const base::FilePath& local_path); |
- void RemoteCheckDone(const base::FilePath& remote_path, |
- drive::FileError error); |
+ void NonNativeLocalPathCheckDone(const base::FilePath& path, bool success); |
#endif |
const std::vector<base::FilePath> paths_; |
@@ -147,23 +143,23 @@ WritableFileChecker::WritableFileChecker( |
void WritableFileChecker::Check() { |
#if defined(OS_CHROMEOS) |
- if (drive::util::IsUnderDriveMountPoint(paths_[0])) { |
+ if (file_manager::util::IsUnderNonNativeLocalPath(profile_, paths_[0])) { |
outstanding_tasks_ = paths_.size(); |
for (std::vector<base::FilePath>::const_iterator it = paths_.begin(); |
it != paths_.end(); |
++it) { |
- DCHECK(drive::util::IsUnderDriveMountPoint(*it)); |
if (is_directory_) { |
- drive::util::CheckDirectoryExists( |
+ file_manager::util::IsNonNativeLocalPathDirectory( |
profile_, |
*it, |
- base::Bind(&WritableFileChecker::RemoteCheckDone, this, *it)); |
+ base::Bind(&WritableFileChecker::NonNativeLocalPathCheckDone, |
+ this, *it)); |
} else { |
- drive::util::PrepareWritableFileAndRun( |
+ file_manager::util::PrepareNonNativeLocalPathWritableFile( |
profile_, |
*it, |
- base::Bind(&WritableFileChecker::CheckRemoteWritableFile, this, |
- *it)); |
+ base::Bind(&WritableFileChecker::NonNativeLocalPathCheckDone, |
+ this, *it)); |
} |
} |
return; |
@@ -216,27 +212,13 @@ void WritableFileChecker::CheckLocalWritableFiles() { |
} |
#if defined(OS_CHROMEOS) |
-void WritableFileChecker::CheckRemoteWritableFile( |
- const base::FilePath& remote_path, |
- drive::FileError error, |
- const base::FilePath& /* local_path */) { |
- RemoteCheckDone(remote_path, error); |
-} |
- |
-void WritableFileChecker::RemoteCheckDone( |
- const base::FilePath& remote_path, |
- drive::FileError error) { |
- if (error == drive::FILE_ERROR_OK) { |
- content::BrowserThread::PostTask( |
- content::BrowserThread::UI, |
- FROM_HERE, |
- base::Bind(&WritableFileChecker::TaskDone, this)); |
- } else { |
- content::BrowserThread::PostTask( |
- content::BrowserThread::UI, |
- FROM_HERE, |
- base::Bind(&WritableFileChecker::Error, this, remote_path)); |
- } |
+void WritableFileChecker::NonNativeLocalPathCheckDone( |
+ const base::FilePath& path, |
+ bool success) { |
+ if (success) |
+ TaskDone(); |
+ else |
+ Error(path); |
} |
#endif |