| Index: chrome/common/safe_browsing/download_protection_util.cc
|
| diff --git a/chrome/common/safe_browsing/download_protection_util.cc b/chrome/common/safe_browsing/download_protection_util.cc
|
| index 88d5cab1b16f3f812b424857080093de30405cc4..ee09cd1e1fe28982e58a8a4778923b48729df34e 100644
|
| --- a/chrome/common/safe_browsing/download_protection_util.cc
|
| +++ b/chrome/common/safe_browsing/download_protection_util.cc
|
| @@ -2,7 +2,10 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "chrome/common/safe_browsing/download_protection_util.h"
|
| +
|
| #include "base/files/file_path.h"
|
| +#include "base/logging.h"
|
|
|
| namespace safe_browsing {
|
| namespace download_protection_util {
|
| @@ -34,5 +37,19 @@ bool IsBinaryFile(const base::FilePath& file) {
|
| IsArchiveFile(file));
|
| }
|
|
|
| +ClientDownloadRequest::DownloadType GetDownloadType(
|
| + const base::FilePath& file) {
|
| + DCHECK(IsBinaryFile(file));
|
| + if (file.MatchesExtension(FILE_PATH_LITERAL(".apk")))
|
| + return ClientDownloadRequest::ANDROID_APK;
|
| + else if (file.MatchesExtension(FILE_PATH_LITERAL(".crx")))
|
| + return ClientDownloadRequest::CHROME_EXTENSION;
|
| + // For zip files, we use the ZIPPED_EXECUTABLE type since we will only send
|
| + // the pingback if we find an executable inside the zip archive.
|
| + else if (file.MatchesExtension(FILE_PATH_LITERAL(".zip")))
|
| + return ClientDownloadRequest::ZIPPED_EXECUTABLE;
|
| + return ClientDownloadRequest::WIN_EXECUTABLE;
|
| +}
|
| +
|
| } // namespace download_protection_util
|
| } // namespace safe_browsing
|
|
|