| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 397 } |
| 398 | 398 |
| 399 void DownloadItem::OnSafeDownloadFinished(DownloadFileManager* file_manager) { | 399 void DownloadItem::OnSafeDownloadFinished(DownloadFileManager* file_manager) { |
| 400 DCHECK_EQ(SAFE, safety_state()); | 400 DCHECK_EQ(SAFE, safety_state()); |
| 401 DCHECK(file_manager); | 401 DCHECK(file_manager); |
| 402 if (NeedsRename()) { | 402 if (NeedsRename()) { |
| 403 BrowserThread::PostTask( | 403 BrowserThread::PostTask( |
| 404 BrowserThread::FILE, FROM_HERE, | 404 BrowserThread::FILE, FROM_HERE, |
| 405 NewRunnableMethod( | 405 NewRunnableMethod( |
| 406 file_manager, &DownloadFileManager::OnFinalDownloadName, | 406 file_manager, &DownloadFileManager::OnFinalDownloadName, |
| 407 id(), GetTargetFilePath(), false, download_manager_)); | 407 id(), GetTargetFilePath(), false, |
| 408 make_scoped_refptr(download_manager_))); |
| 408 return; | 409 return; |
| 409 } | 410 } |
| 410 | 411 |
| 411 Finished(); | 412 Finished(); |
| 412 } | 413 } |
| 413 | 414 |
| 414 void DownloadItem::OnDownloadRenamedToFinalName(const FilePath& full_path) { | 415 void DownloadItem::OnDownloadRenamedToFinalName(const FilePath& full_path) { |
| 415 bool needed_rename = NeedsRename(); | 416 bool needed_rename = NeedsRename(); |
| 416 | 417 |
| 417 Rename(full_path); | 418 Rename(full_path); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 target_name_.value().c_str(), | 491 target_name_.value().c_str(), |
| 491 full_path().value().c_str(), | 492 full_path().value().c_str(), |
| 492 DebugSafetyStateString(safety_state())); | 493 DebugSafetyStateString(safety_state())); |
| 493 } | 494 } |
| 494 | 495 |
| 495 description += base::StringPrintf(" state = %s }", | 496 description += base::StringPrintf(" state = %s }", |
| 496 DebugDownloadStateString(state())); | 497 DebugDownloadStateString(state())); |
| 497 | 498 |
| 498 return description; | 499 return description; |
| 499 } | 500 } |
| OLD | NEW |