OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/drive/download_handler.h" | 5 #include "chrome/browser/chromeos/drive/download_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
10 #include "chrome/browser/chromeos/drive/drive.pb.h" | 10 #include "chrome/browser/chromeos/drive/drive.pb.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 base::Bind(&GetDriveTempDownloadPath, drive_tmp_download_path_), | 289 base::Bind(&GetDriveTempDownloadPath, drive_tmp_download_path_), |
290 callback); | 290 callback); |
291 } else { | 291 } else { |
292 LOG(WARNING) << "Failed to create directory, error = " | 292 LOG(WARNING) << "Failed to create directory, error = " |
293 << FileErrorToString(error); | 293 << FileErrorToString(error); |
294 callback.Run(base::FilePath()); | 294 callback.Run(base::FilePath()); |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
298 void DownloadHandler::UploadDownloadItem(DownloadItem* download) { | 298 void DownloadHandler::UploadDownloadItem(DownloadItem* download) { |
299 DCHECK(download->IsComplete()); | 299 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); |
300 file_write_helper_->PrepareWritableFileAndRun( | 300 file_write_helper_->PrepareWritableFileAndRun( |
301 util::ExtractDrivePath(GetTargetPath(download)), | 301 util::ExtractDrivePath(GetTargetPath(download)), |
302 base::Bind(&MoveDownloadedFile, download->GetTargetFilePath())); | 302 base::Bind(&MoveDownloadedFile, download->GetTargetFilePath())); |
303 } | 303 } |
304 | 304 |
305 } // namespace drive | 305 } // namespace drive |
OLD | NEW |