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

Unified Diff: chrome/browser/extensions/api/file_handlers/app_file_handler_util.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
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

Powered by Google App Engine
This is Rietveld 408576698