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

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

Issue 1348683003: enable download protection on CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit change NULL to nullptr Created 5 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
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 // File method ordering: Methods in this file are in the same order as 5 // File method ordering: Methods in this file are in the same order as
6 // in download_item_impl.h, with the following exception: The public 6 // in download_item_impl.h, with the following exception: The public
7 // interface Start is placed in chronological order with the other 7 // interface Start is placed in chronological order with the other
8 // (private) routines that together define a DownloadItem's state 8 // (private) routines that together define a DownloadItem's state
9 // transitions as the download progresses. See "Download progression 9 // transitions as the download progresses. See "Download progression
10 // cascade" later in this file. 10 // cascade" later in this file.
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 return; 659 return;
660 } 660 }
661 BrowserThread::PostTaskAndReplyWithResult( 661 BrowserThread::PostTaskAndReplyWithResult(
662 BrowserThread::FILE, FROM_HERE, 662 BrowserThread::FILE, FROM_HERE,
663 base::Bind(&DeleteDownloadedFile, current_path_), 663 base::Bind(&DeleteDownloadedFile, current_path_),
664 base::Bind(&DeleteDownloadedFileDone, 664 base::Bind(&DeleteDownloadedFileDone,
665 weak_ptr_factory_.GetWeakPtr(), callback)); 665 weak_ptr_factory_.GetWeakPtr(), callback));
666 } 666 }
667 667
668 bool DownloadItemImpl::IsDangerous() const { 668 bool DownloadItemImpl::IsDangerous() const {
669 #if defined(OS_WIN) || defined(OS_MACOSX) 669 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
670 // TODO(noelutz): At this point only the windows views and OSX UI supports 670 // TODO(noelutz): At this point only the windows views and OSX UI supports
Nathan Parker 2015/10/21 21:10:39 Comment needs updating, or removing.
671 // warnings based on dangerous content. 671 // warnings based on dangerous content.
672 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE || 672 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE ||
673 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL || 673 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL ||
674 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT || 674 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT ||
675 danger_type_ == DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT || 675 danger_type_ == DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT ||
676 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST || 676 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST ||
677 danger_type_ == DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED); 677 danger_type_ == DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED);
678 #else 678 #else
679 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE || 679 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE ||
680 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL); 680 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL);
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 case RESUME_MODE_USER_CONTINUE: 1805 case RESUME_MODE_USER_CONTINUE:
1806 return "USER_CONTINUE"; 1806 return "USER_CONTINUE";
1807 case RESUME_MODE_USER_RESTART: 1807 case RESUME_MODE_USER_RESTART:
1808 return "USER_RESTART"; 1808 return "USER_RESTART";
1809 } 1809 }
1810 NOTREACHED() << "Unknown resume mode " << mode; 1810 NOTREACHED() << "Unknown resume mode " << mode;
1811 return "unknown"; 1811 return "unknown";
1812 } 1812 }
1813 1813
1814 } // namespace content 1814 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698