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 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 5 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 // Do nothing. | 657 // Do nothing. |
658 break; | 658 break; |
659 case DownloadProtectionService::DANGEROUS: | 659 case DownloadProtectionService::DANGEROUS: |
660 item->OnContentCheckCompleted( | 660 item->OnContentCheckCompleted( |
661 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT); | 661 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT); |
662 break; | 662 break; |
663 case DownloadProtectionService::UNCOMMON: | 663 case DownloadProtectionService::UNCOMMON: |
664 item->OnContentCheckCompleted( | 664 item->OnContentCheckCompleted( |
665 content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT); | 665 content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT); |
666 break; | 666 break; |
| 667 case DownloadProtectionService::DANGEROUS_HOST: |
| 668 item->OnContentCheckCompleted( |
| 669 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST); |
| 670 break; |
667 } | 671 } |
668 } | 672 } |
669 | 673 |
670 SafeBrowsingState* state = static_cast<SafeBrowsingState*>( | 674 SafeBrowsingState* state = static_cast<SafeBrowsingState*>( |
671 item->GetUserData(&safe_browsing_id)); | 675 item->GetUserData(&safe_browsing_id)); |
672 state->SetVerdict(result); | 676 state->SetVerdict(result); |
673 } | 677 } |
674 | 678 |
675 // content::NotificationObserver implementation. | 679 // content::NotificationObserver implementation. |
676 void ChromeDownloadManagerDelegate::Observe( | 680 void ChromeDownloadManagerDelegate::Observe( |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 // TODO(asanka): This logic is a hack. DownloadFilePicker should give us a | 892 // TODO(asanka): This logic is a hack. DownloadFilePicker should give us a |
889 // directory to persist. Or perhaps, if the Drive path | 893 // directory to persist. Or perhaps, if the Drive path |
890 // substitution logic is moved here, then we would have a | 894 // substitution logic is moved here, then we would have a |
891 // persistable path after the DownloadFilePicker is done. | 895 // persistable path after the DownloadFilePicker is done. |
892 if (disposition == DownloadItem::TARGET_DISPOSITION_PROMPT && | 896 if (disposition == DownloadItem::TARGET_DISPOSITION_PROMPT && |
893 !download->IsTemporary()) | 897 !download->IsTemporary()) |
894 last_download_path_ = target_path.DirName(); | 898 last_download_path_ = target_path.DirName(); |
895 } | 899 } |
896 callback.Run(target_path, disposition, danger_type, intermediate_path); | 900 callback.Run(target_path, disposition, danger_type, intermediate_path); |
897 } | 901 } |
OLD | NEW |