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 // Helper class which handles communication with the SafeBrowsing servers for | 5 // Helper class which handles communication with the SafeBrowsing servers for |
6 // improved binary download protection. | 6 // improved binary download protection. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
9 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "base/file_path.h" | 18 #include "base/file_path.h" |
19 #include "base/gtest_prod_util.h" | 19 #include "base/gtest_prod_util.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 | 22 |
23 class SafeBrowsingService; | 23 class SafeBrowsingService; |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class DownloadItem; | 26 class DownloadItem; |
| 27 class PageNavigator; |
27 } | 28 } |
28 | 29 |
29 namespace net { | 30 namespace net { |
30 class URLRequestContextGetter; | 31 class URLRequestContextGetter; |
31 class X509Certificate; | 32 class X509Certificate; |
32 } // namespace net | 33 } // namespace net |
33 | 34 |
34 namespace safe_browsing { | 35 namespace safe_browsing { |
35 class SignatureUtil; | 36 class SignatureUtil; |
36 | 37 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 virtual void CheckDownloadUrl(const DownloadInfo& info, | 92 virtual void CheckDownloadUrl(const DownloadInfo& info, |
92 const CheckDownloadCallback& callback); | 93 const CheckDownloadCallback& callback); |
93 | 94 |
94 // Returns true iff the download specified by |info| should be scanned by | 95 // Returns true iff the download specified by |info| should be scanned by |
95 // CheckClientDownload() for malicious content. | 96 // CheckClientDownload() for malicious content. |
96 bool IsSupportedDownload(const DownloadInfo& info) const; | 97 bool IsSupportedDownload(const DownloadInfo& info) const; |
97 | 98 |
98 // Display more information to the user regarding the download specified by | 99 // Display more information to the user regarding the download specified by |
99 // |info|. This method is invoked when the user requests more information | 100 // |info|. This method is invoked when the user requests more information |
100 // about a download that was marked as malicious. | 101 // about a download that was marked as malicious. |
101 void ShowDetailsForDownload(const DownloadInfo& info); | 102 void ShowDetailsForDownload(const DownloadInfo& info, |
| 103 content::PageNavigator* navigator); |
102 | 104 |
103 // Enables or disables the service. This is usually called by the | 105 // Enables or disables the service. This is usually called by the |
104 // SafeBrowsingService, which tracks whether any profile uses these services | 106 // SafeBrowsingService, which tracks whether any profile uses these services |
105 // at all. Disabling causes any pending and future requests to have their | 107 // at all. Disabling causes any pending and future requests to have their |
106 // callbacks called with "SAFE" results. | 108 // callbacks called with "SAFE" results. |
107 void SetEnabled(bool enabled); | 109 void SetEnabled(bool enabled); |
108 | 110 |
109 bool enabled() const { | 111 bool enabled() const { |
110 return enabled_; | 112 return enabled_; |
111 } | 113 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // SignatureUtil object, may be overridden for testing. | 195 // SignatureUtil object, may be overridden for testing. |
194 scoped_refptr<SignatureUtil> signature_util_; | 196 scoped_refptr<SignatureUtil> signature_util_; |
195 | 197 |
196 int64 download_request_timeout_ms_; | 198 int64 download_request_timeout_ms_; |
197 | 199 |
198 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); | 200 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); |
199 }; | 201 }; |
200 } // namespace safe_browsing | 202 } // namespace safe_browsing |
201 | 203 |
202 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ | 204 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ |
OLD | NEW |