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

Side by Side Diff: chrome/browser/chromeos/drive/download_handler.cc

Issue 16018005: Use DownloadItem::GetState() in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stopping complete_animation_ when download is cancelled Created 7 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 unified diff | Download patch
OLDNEW
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 "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 base::Bind(&GetDriveTempDownloadPath, drive_tmp_download_path_), 295 base::Bind(&GetDriveTempDownloadPath, drive_tmp_download_path_),
296 callback); 296 callback);
297 } else { 297 } else {
298 LOG(WARNING) << "Failed to create directory, error = " 298 LOG(WARNING) << "Failed to create directory, error = "
299 << FileErrorToString(error); 299 << FileErrorToString(error);
300 callback.Run(base::FilePath()); 300 callback.Run(base::FilePath());
301 } 301 }
302 } 302 }
303 303
304 void DownloadHandler::UploadDownloadItem(DownloadItem* download) { 304 void DownloadHandler::UploadDownloadItem(DownloadItem* download) {
305 DCHECK(download->IsComplete()); 305 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState());
306 file_write_helper_->PrepareWritableFileAndRun( 306 file_write_helper_->PrepareWritableFileAndRun(
307 util::ExtractDrivePath(GetTargetPath(download)), 307 util::ExtractDrivePath(GetTargetPath(download)),
308 base::Bind(&MoveDownloadedFile, download->GetTargetFilePath())); 308 base::Bind(&MoveDownloadedFile, download->GetTargetFilePath()));
309 } 309 }
310 310
311 } // namespace drive 311 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698