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

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

Issue 11794016: Tweak comments and put in tests for ignoring safe browsing results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 } 584 }
585 585
586 // TODO(asanka): Unify GetSafetyState() and IsDangerous(). 586 // TODO(asanka): Unify GetSafetyState() and IsDangerous().
587 DownloadItem::SafetyState DownloadItemImpl::GetSafetyState() const { 587 DownloadItem::SafetyState DownloadItemImpl::GetSafetyState() const {
588 return safety_state_; 588 return safety_state_;
589 } 589 }
590 590
591 bool DownloadItemImpl::IsDangerous() const { 591 bool DownloadItemImpl::IsDangerous() const {
592 // TODO(noelutz): At this point only the windows views UI supports 592 // TODO(noelutz): At this point only the windows views UI supports
593 // warnings based on dangerous content. 593 // warnings based on dangerous content.
594 #ifdef OS_WIN
asanka 2013/01/07 17:14:31 Why this change? The UI code for non-views doesn't
Randy Smith (Not in Mondays) 2013/01/07 20:55:59 I'd rather not have the set danger test be windows
595 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE || 594 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE ||
596 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL || 595 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL ||
597 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT || 596 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT ||
598 danger_type_ == DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT); 597 danger_type_ == DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT);
599 #else
600 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE ||
601 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL);
602 #endif
603 } 598 }
604 599
605 DownloadDangerType DownloadItemImpl::GetDangerType() const { 600 DownloadDangerType DownloadItemImpl::GetDangerType() const {
606 return danger_type_; 601 return danger_type_;
607 } 602 }
608 603
609 bool DownloadItemImpl::TimeRemaining(base::TimeDelta* remaining) const { 604 bool DownloadItemImpl::TimeRemaining(base::TimeDelta* remaining) const {
610 if (total_bytes_ <= 0) 605 if (total_bytes_ <= 0)
611 return false; // We never received the content_length for this download. 606 return false; // We never received the content_length for this download.
612 607
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 return "CANCELLED"; 1407 return "CANCELLED";
1413 case INTERRUPTED_INTERNAL: 1408 case INTERRUPTED_INTERNAL:
1414 return "INTERRUPTED"; 1409 return "INTERRUPTED";
1415 default: 1410 default:
1416 NOTREACHED() << "Unknown download state " << state; 1411 NOTREACHED() << "Unknown download state " << state;
1417 return "unknown"; 1412 return "unknown";
1418 }; 1413 };
1419 } 1414 }
1420 1415
1421 } // namespace content 1416 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698