summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/gdata/gdata_download_observer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/gdata/gdata_download_observer.cc')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_download_observer.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_download_observer.cc b/chrome/browser/chromeos/gdata/gdata_download_observer.cc
index f5cc19c..4f14a63 100644
--- a/chrome/browser/chromeos/gdata/gdata_download_observer.cc
+++ b/chrome/browser/chromeos/gdata/gdata_download_observer.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/gdata/gdata_download_observer.h"
+#include "base/file_util.h"
#include "chrome/browser/chromeos/gdata/gdata_uploader.h"
#include "chrome/browser/chromeos/gdata/gdata_upload_file_info.h"
#include "chrome/browser/chromeos/gdata/gdata_util.h"
@@ -153,6 +154,20 @@ int GDataDownloadObserver::PercentComplete(DownloadItem* download) {
return -1;
}
+// |gdata_tmp_download_path| is set to a temporary local download path in
+// ~/GCache/v1/tmp/downloads/
+// static
+void GDataDownloadObserver::GetGDataTempDownloadPath(
+ const FilePath& gdata_tmp_download_dir,
+ FilePath* gdata_tmp_download_path) {
+ bool created = file_util::CreateDirectory(gdata_tmp_download_dir);
+ DCHECK(created) << "Can not create temp download directory at "
+ << gdata_tmp_download_dir.value();
+ created = file_util::CreateTemporaryFileInDir(gdata_tmp_download_dir,
+ gdata_tmp_download_path);
+ DCHECK(created) << "Temporary download file creation failed";
+}
+
void GDataDownloadObserver::ManagerGoingDown(
DownloadManager* download_manager) {
download_manager->RemoveObserver(this);