| 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 "content/browser/download/save_package.h" | 5 #include "content/browser/download/save_package.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 final_names.push_back(std::make_pair(it->first, | 657 final_names.push_back(std::make_pair(it->first, |
| 658 it->second->full_path())); | 658 it->second->full_path())); |
| 659 | 659 |
| 660 BrowserThread::PostTask( | 660 BrowserThread::PostTask( |
| 661 BrowserThread::FILE, FROM_HERE, | 661 BrowserThread::FILE, FROM_HERE, |
| 662 base::Bind(&SaveFileManager::RenameAllFiles, | 662 base::Bind(&SaveFileManager::RenameAllFiles, |
| 663 file_manager_, | 663 file_manager_, |
| 664 final_names, | 664 final_names, |
| 665 dir, | 665 dir, |
| 666 web_contents()->GetRenderProcessHost()->GetID(), | 666 web_contents()->GetRenderProcessHost()->GetID(), |
| 667 web_contents()->GetRenderViewHost()->routing_id(), | 667 web_contents()->GetRenderViewHost()->GetRoutingID(), |
| 668 id())); | 668 id())); |
| 669 } | 669 } |
| 670 | 670 |
| 671 // Successfully finished all items of this SavePackage. | 671 // Successfully finished all items of this SavePackage. |
| 672 void SavePackage::Finish() { | 672 void SavePackage::Finish() { |
| 673 // User may cancel the job when we're moving files to the final directory. | 673 // User may cancel the job when we're moving files to the final directory. |
| 674 if (canceled()) | 674 if (canceled()) |
| 675 return; | 675 return; |
| 676 | 676 |
| 677 wait_state_ = SUCCESSFUL; | 677 wait_state_ = SUCCESSFUL; |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 StopObservation(); | 1317 StopObservation(); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 void SavePackage::FinalizeDownloadEntry() { | 1320 void SavePackage::FinalizeDownloadEntry() { |
| 1321 DCHECK(download_); | 1321 DCHECK(download_); |
| 1322 DCHECK(download_manager_); | 1322 DCHECK(download_manager_); |
| 1323 | 1323 |
| 1324 download_manager_->SavePageDownloadFinished(download_); | 1324 download_manager_->SavePageDownloadFinished(download_); |
| 1325 StopObservation(); | 1325 StopObservation(); |
| 1326 } | 1326 } |
| OLD | NEW |