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/drive_download_observer.h" | 5 #include "chrome/browser/chromeos/drive/drive_download_observer.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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 case DownloadItem::INTERRUPTED: | 244 case DownloadItem::INTERRUPTED: |
245 download->SetUserData(&kDrivePathKey, NULL); | 245 download->SetUserData(&kDrivePathKey, NULL); |
246 break; | 246 break; |
247 | 247 |
248 default: | 248 default: |
249 NOTREACHED(); | 249 NOTREACHED(); |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 void DriveDownloadObserver::UploadDownloadItem(DownloadItem* download) { | 253 void DriveDownloadObserver::UploadDownloadItem(DownloadItem* download) { |
| 254 DCHECK(download->IsComplete()); |
254 file_write_helper_->PrepareWritableFileAndRun( | 255 file_write_helper_->PrepareWritableFileAndRun( |
255 GetDrivePath(download), | 256 GetDrivePath(download), |
256 base::Bind(&MoveDownloadedFile, download->GetFullPath())); | 257 base::Bind(&MoveDownloadedFile, download->GetTargetFilePath())); |
257 } | 258 } |
258 | 259 |
259 } // namespace drive | 260 } // namespace drive |
OLD | NEW |