Chromium Code Reviews| 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 <memory> | 10 #include <memory> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 | 24 |
| 25 namespace certificate_reporting { | 25 namespace certificate_reporting { |
| 26 class ErrorReporter; | 26 class ErrorReporter; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 class SSLInfo; | 30 class SSLInfo; |
| 31 class URLRequestContextGetter; | 31 class URLRequestContextGetter; |
| 32 } // namespace net | 32 } // namespace net |
| 33 | 33 |
| 34 enum class PermissionRequestGestureType; | |
|
raymes
2016/07/27 01:42:05
same here
stefanocs
2016/07/27 02:58:18
Done.
| |
| 35 | |
| 34 namespace safe_browsing { | 36 namespace safe_browsing { |
| 35 | 37 |
| 36 class PermissionReporter; | 38 class PermissionReporter; |
| 37 | 39 |
| 38 class SafeBrowsingPingManager : public net::URLFetcherDelegate { | 40 class SafeBrowsingPingManager : public net::URLFetcherDelegate { |
| 39 public: | 41 public: |
| 40 ~SafeBrowsingPingManager() override; | 42 ~SafeBrowsingPingManager() override; |
| 41 | 43 |
| 42 // Create an instance of the safe browsing ping manager. | 44 // Create an instance of the safe browsing ping manager. |
| 43 static std::unique_ptr<SafeBrowsingPingManager> Create( | 45 static std::unique_ptr<SafeBrowsingPingManager> Create( |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 62 | 64 |
| 63 void SetCertificateErrorReporterForTesting( | 65 void SetCertificateErrorReporterForTesting( |
| 64 std::unique_ptr<certificate_reporting::ErrorReporter> | 66 std::unique_ptr<certificate_reporting::ErrorReporter> |
| 65 certificate_error_reporter); | 67 certificate_error_reporter); |
| 66 | 68 |
| 67 // Report permission action to SafeBrowsing servers. | 69 // Report permission action to SafeBrowsing servers. |
| 68 void ReportPermissionAction(const GURL& origin, | 70 void ReportPermissionAction(const GURL& origin, |
| 69 content::PermissionType permission, | 71 content::PermissionType permission, |
| 70 PermissionAction action, | 72 PermissionAction action, |
| 71 PermissionSourceUI source_ui, | 73 PermissionSourceUI source_ui, |
| 72 bool user_gesture); | 74 PermissionRequestGestureType gesture_type); |
| 73 | 75 |
| 74 private: | 76 private: |
| 75 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, | 77 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, |
| 76 TestSafeBrowsingHitUrl); | 78 TestSafeBrowsingHitUrl); |
| 77 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, TestThreatDetailsUrl); | 79 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, TestThreatDetailsUrl); |
| 78 | 80 |
| 79 typedef std::set<const net::URLFetcher*> Reports; | 81 typedef std::set<const net::URLFetcher*> Reports; |
| 80 | 82 |
| 81 // Constructs a SafeBrowsingPingManager that issues network requests | 83 // Constructs a SafeBrowsingPingManager that issues network requests |
| 82 // using |request_context_getter|. | 84 // using |request_context_getter|. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 113 | 115 |
| 114 // Sends reports of permission actions. | 116 // Sends reports of permission actions. |
| 115 std::unique_ptr<PermissionReporter> permission_reporter_; | 117 std::unique_ptr<PermissionReporter> permission_reporter_; |
| 116 | 118 |
| 117 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager); | 119 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager); |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace safe_browsing | 122 } // namespace safe_browsing |
| 121 | 123 |
| 122 #endif // CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ | 124 #endif // CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ |
| OLD | NEW |