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

Unified Diff: chrome/browser/extensions/webstore_installer.cc

Issue 10703083: Fix extensions download when default download location is drive. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/webstore_installer.cc
===================================================================
--- chrome/browser/extensions/webstore_installer.cc (revision 145171)
+++ chrome/browser/extensions/webstore_installer.cc (working copy)
@@ -38,6 +38,10 @@
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/gdata/gdata_util.h"
+#endif
+
using content::BrowserContext;
using content::BrowserThread;
using content::DownloadId;
@@ -93,9 +97,15 @@
void GetDownloadFilePath(
const FilePath& download_directory, const std::string& id,
const base::Callback<void(const FilePath&)>& callback) {
- const FilePath& directory(g_download_directory_for_tests ?
- *g_download_directory_for_tests : download_directory);
+ FilePath directory(g_download_directory_for_tests ?
+ *g_download_directory_for_tests : download_directory);
+#if defined (OS_CHROMEOS)
+ // Do not use drive for extension downloads.
+ if (gdata::util::IsUnderGDataMountPoint(directory))
+ directory = download_util::GetDefaultDownloadDirectory();
+#endif
+
// Ensure the download directory exists. TODO(asargent) - make this use
// common code from the downloads system.
if (!file_util::DirectoryExists(directory)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698