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

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: Changed to only target Malicious (not Maybe-Malicious or Dangerous) files 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::NonMaliciousInProgressCount() 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->GetDangerType() != DOWNLOAD_DANGER_TYPE_DANGEROUS_URL &&
felt 2013/10/18 01:50:54 pkasting: changed to this, to address your concern
682 it->second->GetDangerType() != DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT &&
683 it->second->GetDangerType() != DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST) {
684 ++count;
685 }
686 }
687 return count;
688 }
689
676 DownloadItem* DownloadManagerImpl::GetDownload(uint32 download_id) { 690 DownloadItem* DownloadManagerImpl::GetDownload(uint32 download_id) {
677 return ContainsKey(downloads_, download_id) ? downloads_[download_id] : NULL; 691 return ContainsKey(downloads_, download_id) ? downloads_[download_id] : NULL;
678 } 692 }
679 693
680 void DownloadManagerImpl::GetAllDownloads(DownloadVector* downloads) { 694 void DownloadManagerImpl::GetAllDownloads(DownloadVector* downloads) {
681 for (DownloadMap::iterator it = downloads_.begin(); 695 for (DownloadMap::iterator it = downloads_.begin();
682 it != downloads_.end(); ++it) { 696 it != downloads_.end(); ++it) {
683 downloads->push_back(it->second); 697 downloads->push_back(it->second);
684 } 698 }
685 } 699 }
(...skipping 12 matching lines...) Expand all
698 if (delegate_) 712 if (delegate_)
699 delegate_->OpenDownload(download); 713 delegate_->OpenDownload(download);
700 } 714 }
701 715
702 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 716 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
703 if (delegate_) 717 if (delegate_)
704 delegate_->ShowDownloadInShell(download); 718 delegate_->ShowDownloadInShell(download);
705 } 719 }
706 720
707 } // namespace content 721 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl.h ('k') | content/public/browser/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698