Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: chrome/common/safe_browsing/download_protection_util.h

Issue 1979153002: Use FileTypePolicies for is_archive and is_supported classifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_by_platform
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_COMMON_SAFE_BROWSING_DOWNLOAD_PROTECTION_UTIL_H_ 5 #ifndef CHROME_COMMON_SAFE_BROWSING_DOWNLOAD_PROTECTION_UTIL_H_
6 #define CHROME_COMMON_SAFE_BROWSING_DOWNLOAD_PROTECTION_UTIL_H_ 6 #define CHROME_COMMON_SAFE_BROWSING_DOWNLOAD_PROTECTION_UTIL_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "chrome/common/safe_browsing/csd.pb.h" 9 #include "chrome/common/safe_browsing/csd.pb.h"
10 10
11 namespace safe_browsing { 11 namespace safe_browsing {
12 namespace download_protection_util { 12 namespace download_protection_util {
13 13
14 // Returns true if the given file is a supported binary file type.
15 bool IsSupportedBinaryFile(const base::FilePath& file);
16
17 // Returns true if the given file is a supported archive file type.
18 bool IsArchiveFile(const base::FilePath& file);
19
20 // Returns the DownloadType of the file at |path|. This function is only valid 14 // Returns the DownloadType of the file at |path|. This function is only valid
21 // for paths that satisfy IsSupportedBinaryFile() above. 15 // for paths that satisfy IsSupportedBinaryFile() above.
22 ClientDownloadRequest::DownloadType GetDownloadType(const base::FilePath& file); 16 ClientDownloadRequest::DownloadType GetDownloadType(const base::FilePath& file);
23 17
24 // Returns the extension of the file at |path|.
25 const base::FilePath::StringType GetFileExtension(const base::FilePath& file);
26
27 // The maximum value returned by GetSBClientDownloadExtensionValueForUMA() + 1.
28 extern const int kSBClientDownloadExtensionsMax;
29
30 // SBClientDownloadExtensions UMA enum value corresponding to |file|.
31 int GetSBClientDownloadExtensionValueForUMA(const base::FilePath& file);
32
33 } // namespace download_protection_util 18 } // namespace download_protection_util
34 } // namespace safe_browsing 19 } // namespace safe_browsing
35 20
36 #endif // CHROME_COMMON_SAFE_BROWSING_DOWNLOAD_PROTECTION_UTIL_H_ 21 #endif // CHROME_COMMON_SAFE_BROWSING_DOWNLOAD_PROTECTION_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698