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

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: Created 7 years, 7 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 "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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698