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

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

Issue 26938003: Don't prompt to save malicious downloads on exit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit test compile error Created 7 years, 2 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 int DownloadManagerImpl::InProgressCount() const { 666 int DownloadManagerImpl::InProgressCount() const {
667 int count = 0; 667 int count = 0;
668 for (DownloadMap::const_iterator it = downloads_.begin(); 668 for (DownloadMap::const_iterator it = downloads_.begin();
669 it != downloads_.end(); ++it) { 669 it != downloads_.end(); ++it) {
670 if (it->second->GetState() == DownloadItem::IN_PROGRESS) 670 if (it->second->GetState() == DownloadItem::IN_PROGRESS)
671 ++count; 671 ++count;
672 } 672 }
673 return count; 673 return count;
674 } 674 }
675 675
676 int DownloadManagerImpl::NonDangerousInProgressCount() const {
677 int count = 0;
678 for (DownloadMap::const_iterator it = downloads_.begin();
679 it != downloads_.end(); ++it) {
680 if ((it->second->GetState() == DownloadItem::IN_PROGRESS) &&
681 !it->second->IsDangerous()) {
682 ++count;
683 }
684 }
685 return count;
686 }
687
676 DownloadItem* DownloadManagerImpl::GetDownload(uint32 download_id) { 688 DownloadItem* DownloadManagerImpl::GetDownload(uint32 download_id) {
677 return ContainsKey(downloads_, download_id) ? downloads_[download_id] : NULL; 689 return ContainsKey(downloads_, download_id) ? downloads_[download_id] : NULL;
678 } 690 }
679 691
680 void DownloadManagerImpl::GetAllDownloads(DownloadVector* downloads) { 692 void DownloadManagerImpl::GetAllDownloads(DownloadVector* downloads) {
681 for (DownloadMap::iterator it = downloads_.begin(); 693 for (DownloadMap::iterator it = downloads_.begin();
682 it != downloads_.end(); ++it) { 694 it != downloads_.end(); ++it) {
683 downloads->push_back(it->second); 695 downloads->push_back(it->second);
684 } 696 }
685 } 697 }
(...skipping 12 matching lines...) Expand all
698 if (delegate_) 710 if (delegate_)
699 delegate_->OpenDownload(download); 711 delegate_->OpenDownload(download);
700 } 712 }
701 713
702 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 714 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
703 if (delegate_) 715 if (delegate_)
704 delegate_->ShowDownloadInShell(download); 716 delegate_->ShowDownloadInShell(download);
705 } 717 }
706 718
707 } // namespace content 719 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698