OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_POLICY_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_POLICY_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_POLICY_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_POLICY_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/files/file_path.h" |
9 | 12 |
10 class GURL; | 13 class GURL; |
11 | 14 |
12 namespace base { | |
13 class FilePath; | |
14 } | |
15 | |
16 namespace safe_browsing { | 15 namespace safe_browsing { |
17 | 16 |
18 enum class UnverifiedDownloadPolicy { ALLOWED, DISALLOWED }; | 17 enum class UnverifiedDownloadPolicy { ALLOWED, DISALLOWED }; |
19 | 18 |
20 using UnverifiedDownloadCheckCompletionCallback = | 19 using UnverifiedDownloadCheckCompletionCallback = |
21 base::Callback<void(UnverifiedDownloadPolicy)>; | 20 base::Callback<void(UnverifiedDownloadPolicy)>; |
22 | 21 |
23 // Invokes |callback| on the current thread with the effective download policy | 22 // Invokes |callback| on the current thread with the effective download policy |
24 // for an unverified download of |file| by |requestor|. | 23 // for an unverified download of |file| by |requestor|. If it is possible for |
| 24 // the file to be downloaded with alternate file extensions, they should be |
| 25 // specified in |alternate_extensions|. |
25 void CheckUnverifiedDownloadPolicy( | 26 void CheckUnverifiedDownloadPolicy( |
26 const GURL& requestor, | 27 const GURL& requestor, |
27 const base::FilePath& file, | 28 const base::FilePath& file, |
| 29 const std::vector<base::FilePath::StringType>& alternate_extensions, |
28 const UnverifiedDownloadCheckCompletionCallback& callback); | 30 const UnverifiedDownloadCheckCompletionCallback& callback); |
29 | 31 |
30 } // namespace safe_browsing | 32 } // namespace safe_browsing |
31 | 33 |
32 #endif // CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_POLICY_H_ | 34 #endif // CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_POLICY_H_ |
OLD | NEW |