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

Unified Diff: chrome/browser/download/download_file_picker_chromeos.cc

Issue 12040095: chromeos: Rename DriveDownloadHandler::GetDrivePath() to GetTargetPath(), make it return full path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 7 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
« no previous file with comments | « chrome/browser/chromeos/drive/drive_download_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_file_picker_chromeos.cc
diff --git a/chrome/browser/download/download_file_picker_chromeos.cc b/chrome/browser/download/download_file_picker_chromeos.cc
index 1819af5fb70771ffa4c86266dc17269c031bfbbc..a216d947425b745bb2b09657f9903526895e3e72 100644
--- a/chrome/browser/download/download_file_picker_chromeos.cc
+++ b/chrome/browser/download/download_file_picker_chromeos.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/i18n/file_util_icu.h"
#include "chrome/browser/chromeos/drive/drive_download_handler.h"
-#include "chrome/browser/chromeos/drive/drive_file_system_util.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
@@ -24,18 +23,17 @@ DownloadFilePickerChromeOS::~DownloadFilePickerChromeOS() {
void DownloadFilePickerChromeOS::InitSuggestedPath(DownloadItem* item,
const FilePath& path) {
- // For Drive downloads, |path| is the virtual gdata path instead of the
- // temporary local one.
+ // For Drive downloads, we should pass the drive path instead of the temporary
+ // file path.
Profile* profile =
Profile::FromBrowserContext(download_manager_->GetBrowserContext());
drive::DriveDownloadHandler* drive_download_handler =
drive::DriveDownloadHandler::GetForProfile(profile);
- if (drive_download_handler && drive_download_handler->IsDriveDownload(item)) {
- set_suggested_path(drive::util::GetSpecialRemoteRootPath().Append(
- drive_download_handler->GetDrivePath(item)));
- } else {
- DownloadFilePicker::InitSuggestedPath(item, path);
- }
+ FilePath suggested_path = path;
+ if (drive_download_handler && drive_download_handler->IsDriveDownload(item))
+ suggested_path = drive_download_handler->GetTargetPath(item);
+
+ DownloadFilePicker::InitSuggestedPath(item, suggested_path);
}
void DownloadFilePickerChromeOS::FileSelected(const FilePath& selected_path,
« no previous file with comments | « chrome/browser/chromeos/drive/drive_download_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698