| 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 } | 722 } |
| 723 #endif | 723 #endif |
| 724 callback.Run(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); | 724 callback.Run(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); |
| 725 } | 725 } |
| 726 | 726 |
| 727 void ChromeDownloadManagerDelegate::GetFileMimeType( | 727 void ChromeDownloadManagerDelegate::GetFileMimeType( |
| 728 const base::FilePath& path, | 728 const base::FilePath& path, |
| 729 const GetFileMimeTypeCallback& callback) { | 729 const GetFileMimeTypeCallback& callback) { |
| 730 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 730 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 731 base::PostTaskWithTraitsAndReplyWithResult( | 731 base::PostTaskWithTraitsAndReplyWithResult( |
| 732 FROM_HERE, base::TaskTraits().MayBlock(), base::Bind(&GetMimeType, path), | 732 FROM_HERE, {base::MayBlock()}, base::Bind(&GetMimeType, path), callback); |
| 733 callback); | |
| 734 } | 733 } |
| 735 | 734 |
| 736 #if defined(FULL_SAFE_BROWSING) | 735 #if defined(FULL_SAFE_BROWSING) |
| 737 void ChromeDownloadManagerDelegate::CheckClientDownloadDone( | 736 void ChromeDownloadManagerDelegate::CheckClientDownloadDone( |
| 738 uint32_t download_id, | 737 uint32_t download_id, |
| 739 DownloadProtectionService::DownloadCheckResult result) { | 738 DownloadProtectionService::DownloadCheckResult result) { |
| 740 DownloadItem* item = download_manager_->GetDownload(download_id); | 739 DownloadItem* item = download_manager_->GetDownload(download_id); |
| 741 if (!item || (item->GetState() != DownloadItem::IN_PROGRESS)) | 740 if (!item || (item->GetState() != DownloadItem::IN_PROGRESS)) |
| 742 return; | 741 return; |
| 743 | 742 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 862 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
| 864 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 863 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
| 865 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 864 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
| 866 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 865 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
| 867 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 866 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
| 868 return true; | 867 return true; |
| 869 } | 868 } |
| 870 #endif | 869 #endif |
| 871 return false; | 870 return false; |
| 872 } | 871 } |
| OLD | NEW |