| 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..a94a4c45fed76aed61c0ba79417f655133bf137c 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 SpecialPathCheckDone(const base::FilePath& path, bool success);
|
| #endif
|
|
|
| const std::vector<base::FilePath> paths_;
|
| @@ -147,23 +143,22 @@ WritableFileChecker::WritableFileChecker(
|
|
|
| void WritableFileChecker::Check() {
|
| #if defined(OS_CHROMEOS)
|
| - if (drive::util::IsUnderDriveMountPoint(paths_[0])) {
|
| + if (file_manager::util::IsUnderSpecialPath(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));
|
| + DCHECK(file_manager::util::IsUnderSpecialPath(profile_, paths_[0]));
|
| if (is_directory_) {
|
| - drive::util::CheckDirectoryExists(
|
| + file_manager::util::IsSpecialPathDirectory(
|
| profile_,
|
| *it,
|
| - base::Bind(&WritableFileChecker::RemoteCheckDone, this, *it));
|
| + base::Bind(&WritableFileChecker::SpecialPathCheckDone, this, *it));
|
| } else {
|
| - drive::util::PrepareWritableFileAndRun(
|
| + file_manager::util::PrepareSpecialPathWritableFile(
|
| profile_,
|
| *it,
|
| - base::Bind(&WritableFileChecker::CheckRemoteWritableFile, this,
|
| - *it));
|
| + base::Bind(&WritableFileChecker::SpecialPathCheckDone, this, *it));
|
| }
|
| }
|
| return;
|
| @@ -216,27 +211,12 @@ 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::SpecialPathCheckDone(const base::FilePath& path,
|
| + bool success) {
|
| + if (success)
|
| + TaskDone();
|
| + else
|
| + Error(path);
|
| }
|
| #endif
|
|
|
|
|