OLD | NEW |
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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 bool DownloadItemImpl::GetFileExternallyRemoved() const { | 582 bool DownloadItemImpl::GetFileExternallyRemoved() const { |
583 return file_externally_removed_; | 583 return file_externally_removed_; |
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 #ifdef OS_WIN |
592 // TODO(noelutz): At this point only the windows views UI supports | 593 // TODO(noelutz): At this point only the windows views UI supports |
593 // warnings based on dangerous content. | 594 // warnings based on dangerous content. |
594 #ifdef OS_WIN | |
595 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE || | 595 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE || |
596 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL || | 596 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL || |
597 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT || | 597 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT || |
598 danger_type_ == DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT); | 598 danger_type_ == DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT); |
599 #else | 599 #else |
600 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE || | 600 return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE || |
601 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL); | 601 danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL); |
602 #endif | 602 #endif |
603 } | 603 } |
604 | 604 |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 return "CANCELLED"; | 1412 return "CANCELLED"; |
1413 case INTERRUPTED_INTERNAL: | 1413 case INTERRUPTED_INTERNAL: |
1414 return "INTERRUPTED"; | 1414 return "INTERRUPTED"; |
1415 default: | 1415 default: |
1416 NOTREACHED() << "Unknown download state " << state; | 1416 NOTREACHED() << "Unknown download state " << state; |
1417 return "unknown"; | 1417 return "unknown"; |
1418 }; | 1418 }; |
1419 } | 1419 } |
1420 | 1420 |
1421 } // namespace content | 1421 } // namespace content |
OLD | NEW |