| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/download/download_item.h" | 5 #include "chrome/browser/download/download_item.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/i18n/case_conversion.h" | 10 #include "base/i18n/case_conversion.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 void DownloadItem::Rename(const FilePath& full_path) { | 451 void DownloadItem::Rename(const FilePath& full_path) { |
| 452 VLOG(20) << __FUNCTION__ << "()" | 452 VLOG(20) << __FUNCTION__ << "()" |
| 453 << " full_path = \"" << full_path.value() << "\"" | 453 << " full_path = \"" << full_path.value() << "\"" |
| 454 << " " << DebugString(true); | 454 << " " << DebugString(true); |
| 455 DCHECK(!full_path.empty()); | 455 DCHECK(!full_path.empty()); |
| 456 full_path_ = full_path; | 456 full_path_ = full_path; |
| 457 } | 457 } |
| 458 | 458 |
| 459 void DownloadItem::TogglePause() { | 459 void DownloadItem::TogglePause() { |
| 460 DCHECK(IsInProgress()); | 460 DCHECK(IsInProgress()); |
| 461 download_manager_->PauseDownload(download_id_, !is_paused_); | 461 process_handle_.PauseRequest(!is_paused_); |
| 462 is_paused_ = !is_paused_; | 462 is_paused_ = !is_paused_; |
| 463 UpdateObservers(); | 463 UpdateObservers(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 void DownloadItem::OnDownloadCompleting(DownloadFileManager* file_manager) { | 466 void DownloadItem::OnDownloadCompleting(DownloadFileManager* file_manager) { |
| 467 VLOG(20) << __FUNCTION__ << "()" | 467 VLOG(20) << __FUNCTION__ << "()" |
| 468 << " needs rename = " << NeedsRename() | 468 << " needs rename = " << NeedsRename() |
| 469 << " " << DebugString(true); | 469 << " " << DebugString(true); |
| 470 DCHECK_NE(DANGEROUS, safety_state()); | 470 DCHECK_NE(DANGEROUS, safety_state()); |
| 471 DCHECK(file_manager); | 471 DCHECK(file_manager); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 state_info_.target_name.value().c_str(), | 670 state_info_.target_name.value().c_str(), |
| 671 full_path().value().c_str()); | 671 full_path().value().c_str()); |
| 672 } else { | 672 } else { |
| 673 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); | 673 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); |
| 674 } | 674 } |
| 675 | 675 |
| 676 description += " }"; | 676 description += " }"; |
| 677 | 677 |
| 678 return description; | 678 return description; |
| 679 } | 679 } |
| OLD | NEW |