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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.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: 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_system/file_system_api.cc
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc
index fee90cba6dd704b109cad4d4ce2121a8485757d8..5e135a2175d92e35266fa0a70a32d814442b8ebb 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -50,7 +50,7 @@
#endif
#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::SavedFileEntry;
@@ -680,13 +680,24 @@ void FileSystemChooseEntryFunction::FilesSelected(
}
content::WebContents* web_contents = app_window->web_contents();
+ DCHECK_EQ(paths.size(), 1u);
+ std::vector<base::FilePath> check_paths;
+#if defined(OS_CHROMEOS)
+ check_paths.push_back(
+ file_manager::util::IsUnderSpecialPath(GetProfile(), paths[0])
+ ? paths[0]
+ : base::MakeAbsoluteFilePath(paths[0]));
+#else
+ check_paths.push_back(base::MakeAbsoluteFilePath(paths[0]));
+#endif
+
content::BrowserThread::PostTask(
content::BrowserThread::FILE,
FROM_HERE,
base::Bind(
&FileSystemChooseEntryFunction::ConfirmDirectoryAccessOnFileThread,
this,
- paths,
+ check_paths,
web_contents));
return;
}
@@ -703,13 +714,8 @@ void FileSystemChooseEntryFunction::ConfirmDirectoryAccessOnFileThread(
const std::vector<base::FilePath>& paths,
content::WebContents* web_contents) {
DCHECK_EQ(paths.size(), 1u);
-#if defined(OS_CHROMEOS)
- const base::FilePath path =
- drive::util::IsUnderDriveMountPoint(paths[0]) ? paths[0] :
- base::MakeAbsoluteFilePath(paths[0]);
-#else
- const base::FilePath path = base::MakeAbsoluteFilePath(paths[0]);
-#endif
+ const base::FilePath& path = paths[0];
+
if (path.empty()) {
content::BrowserThread::PostTask(
content::BrowserThread::UI,

Powered by Google App Engine
This is Rietveld 408576698