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

Side by Side Diff: content/browser/download/download_manager_impl.cc

Issue 134373003: Return error to chrome.downloads.removeFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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 | Annotate | Revision Log
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 "content/browser/download/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 base::Bind(&DownloadManagerImpl::OnFileExistenceChecked, 459 base::Bind(&DownloadManagerImpl::OnFileExistenceChecked,
460 weak_factory_.GetWeakPtr(), download_item->GetId())); 460 weak_factory_.GetWeakPtr(), download_item->GetId()));
461 } 461 }
462 } 462 }
463 463
464 void DownloadManagerImpl::OnFileExistenceChecked(uint32 download_id, 464 void DownloadManagerImpl::OnFileExistenceChecked(uint32 download_id,
465 bool result) { 465 bool result) {
466 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 466 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
467 if (!result) { // File does not exist. 467 if (!result) { // File does not exist.
468 if (ContainsKey(downloads_, download_id)) 468 if (ContainsKey(downloads_, download_id))
469 downloads_[download_id]->OnDownloadedFileRemoved(true); 469 downloads_[download_id]->OnDownloadedFileRemoved();
470 } 470 }
471 } 471 }
472 472
473 BrowserContext* DownloadManagerImpl::GetBrowserContext() const { 473 BrowserContext* DownloadManagerImpl::GetBrowserContext() const {
474 return browser_context_; 474 return browser_context_;
475 } 475 }
476 476
477 void DownloadManagerImpl::CreateSavePackageDownloadItem( 477 void DownloadManagerImpl::CreateSavePackageDownloadItem(
478 const base::FilePath& main_file_path, 478 const base::FilePath& main_file_path,
479 const GURL& page_url, 479 const GURL& page_url,
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 if (delegate_) 708 if (delegate_)
709 delegate_->OpenDownload(download); 709 delegate_->OpenDownload(download);
710 } 710 }
711 711
712 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 712 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
713 if (delegate_) 713 if (delegate_)
714 delegate_->ShowDownloadInShell(download); 714 delegate_->ShowDownloadInShell(download);
715 } 715 }
716 716
717 } // namespace content 717 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | content/browser/download/download_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698