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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 137343008: Make chrome.fileSystem.chooseEntry work on Google Drive directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test. Created 6 years, 11 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 0e9c267056ac5db63e107a2b1ad92f75fdbbadad..6ad9a61f5578f36710e4c71ca98f24d150ec9528 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -49,6 +49,10 @@
#include "base/mac/foundation_util.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/drive/file_system_util.h"
+#endif
+
using apps::SavedFileEntry;
using apps::SavedFilesService;
using apps::ShellWindow;
@@ -698,7 +702,13 @@ 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
if (path.empty()) {
content::BrowserThread::PostTask(
content::BrowserThread::UI,

Powered by Google App Engine
This is Rietveld 408576698