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 #ifndef CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ |
7 | 7 |
8 // A class that reports safebrowsing statistics to Google's SafeBrowsing | 8 // A class that reports safebrowsing statistics to Google's SafeBrowsing |
9 // servers. | 9 // servers. |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" | 16 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" |
17 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 17 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
18 #include "net/url_request/url_fetcher_delegate.h" | 18 #include "net/url_request/url_fetcher_delegate.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
21 namespace chrome_browser_net { | 21 namespace chrome_browser_net { |
22 class CertificateErrorReporter; | 22 class CertificateErrorReporter; |
| 23 class CertLoggerRequest; |
23 } | 24 } |
24 | 25 |
25 namespace net { | 26 namespace net { |
26 class SSLInfo; | 27 class SSLInfo; |
27 class URLRequestContextGetter; | 28 class URLRequestContextGetter; |
28 } // namespace net | 29 } // namespace net |
29 | 30 |
30 | 31 |
31 class SafeBrowsingPingManager : public net::URLFetcherDelegate { | 32 class SafeBrowsingPingManager : public net::URLFetcherDelegate { |
32 public: | 33 public: |
(...skipping 16 matching lines...) Expand all Loading... |
49 bool is_subresource, | 50 bool is_subresource, |
50 SBThreatType threat_type, | 51 SBThreatType threat_type, |
51 const std::string& post_data); | 52 const std::string& post_data); |
52 | 53 |
53 // Users can opt-in on the SafeBrowsing interstitial to send detailed | 54 // Users can opt-in on the SafeBrowsing interstitial to send detailed |
54 // malware reports. |report| is the serialized report. | 55 // malware reports. |report| is the serialized report. |
55 void ReportMalwareDetails(const std::string& report); | 56 void ReportMalwareDetails(const std::string& report); |
56 | 57 |
57 // Users can opt-in on the SSL interstitial to send reports of invalid | 58 // Users can opt-in on the SSL interstitial to send reports of invalid |
58 // certificate chains. | 59 // certificate chains. |
59 void ReportInvalidCertificateChain(const std::string& hostname, | 60 void ReportInvalidCertificateChain( |
60 const net::SSLInfo& ssl_info); | 61 const chrome_browser_net::CertLoggerRequest& report); |
61 | 62 |
62 void SetCertificateErrorReporterForTesting(scoped_ptr< | 63 void SetCertificateErrorReporterForTesting(scoped_ptr< |
63 chrome_browser_net::CertificateErrorReporter> certificate_error_reporter); | 64 chrome_browser_net::CertificateErrorReporter> certificate_error_reporter); |
64 | 65 |
65 private: | 66 private: |
66 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, | 67 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, |
67 TestSafeBrowsingHitUrl); | 68 TestSafeBrowsingHitUrl); |
68 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, | 69 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, |
69 TestMalwareDetailsUrl); | 70 TestMalwareDetailsUrl); |
70 | 71 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 Reports safebrowsing_reports_; | 103 Reports safebrowsing_reports_; |
103 | 104 |
104 // Sends reports of invalid SSL certificate chains. | 105 // Sends reports of invalid SSL certificate chains. |
105 scoped_ptr<chrome_browser_net::CertificateErrorReporter> | 106 scoped_ptr<chrome_browser_net::CertificateErrorReporter> |
106 certificate_error_reporter_; | 107 certificate_error_reporter_; |
107 | 108 |
108 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager); | 109 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager); |
109 }; | 110 }; |
110 | 111 |
111 #endif // CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ | 112 #endif // CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ |
OLD | NEW |