| Index: chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
|
| diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
|
| index fad01ff1eabba476574c149855fe12563f8758f2..b007857181663caa7ec709844d9331593b52653c 100644
|
| --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
|
| +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
|
| @@ -25,6 +25,7 @@
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/safe_browsing/csd.pb.h"
|
| #include "chrome/common/safe_browsing/download_protection_util.h"
|
| +#include "chrome/common/safe_browsing/file_type_policies.h"
|
| #include "components/history/core/browser/download_constants.h"
|
| #include "components/history/core/browser/history_service.h"
|
| #include "components/prefs/pref_service.h"
|
| @@ -91,15 +92,17 @@ bool IsBinaryDownloadForCurrentOS(
|
| bool IsBinaryDownload(const history::DownloadRow& row) {
|
| // TODO(grt): Peek into archives to see if they contain binaries;
|
| // http://crbug.com/386915.
|
| - return (download_protection_util::IsSupportedBinaryFile(row.target_path) &&
|
| - !download_protection_util::IsArchiveFile(row.target_path) &&
|
| + FileTypePolicies* policies = FileTypePolicies::GetInstance();
|
| + return (policies->IsCheckedBinaryFile(row.target_path) &&
|
| + !policies->IsArchiveFile(row.target_path) &&
|
| IsBinaryDownloadForCurrentOS(
|
| download_protection_util::GetDownloadType(row.target_path)));
|
| }
|
|
|
| // Returns true if a download represented by a DownloadRow is not a binary file.
|
| bool IsNonBinaryDownload(const history::DownloadRow& row) {
|
| - return !download_protection_util::IsSupportedBinaryFile(row.target_path);
|
| + return !FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
|
| + row.target_path);
|
| }
|
|
|
| // Returns true if a download represented by a DownloadDetails is binary file
|
| @@ -213,8 +216,7 @@ void PopulateNonBinaryDetailsFromRow(
|
| const history::DownloadRow& download,
|
| ClientIncidentReport_NonBinaryDownloadDetails* details) {
|
| details->set_file_type(
|
| - base::FilePath(
|
| - download_protection_util::GetFileExtension(download.target_path))
|
| + base::FilePath(FileTypePolicies::GetFileExtension(download.target_path))
|
| .AsUTF8Unsafe());
|
| details->set_length(download.received_bytes);
|
| if (download.url_chain.back().has_host())
|
|
|