| 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> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "chrome/browser/permissions/permission_request.h" |
| 17 #include "chrome/browser/permissions/permission_uma_util.h" | 18 #include "chrome/browser/permissions/permission_uma_util.h" |
| 18 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" | 19 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" |
| 19 #include "components/safe_browsing_db/hit_report.h" | 20 #include "components/safe_browsing_db/hit_report.h" |
| 20 #include "components/safe_browsing_db/util.h" | 21 #include "components/safe_browsing_db/util.h" |
| 21 #include "content/public/browser/permission_type.h" | 22 #include "content/public/browser/permission_type.h" |
| 22 #include "net/url_request/url_fetcher_delegate.h" | 23 #include "net/url_request/url_fetcher_delegate.h" |
| 23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 24 | 25 |
| 25 namespace certificate_reporting { | 26 namespace certificate_reporting { |
| 26 class ErrorReporter; | 27 class ErrorReporter; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 63 |
| 63 void SetCertificateErrorReporterForTesting( | 64 void SetCertificateErrorReporterForTesting( |
| 64 std::unique_ptr<certificate_reporting::ErrorReporter> | 65 std::unique_ptr<certificate_reporting::ErrorReporter> |
| 65 certificate_error_reporter); | 66 certificate_error_reporter); |
| 66 | 67 |
| 67 // Report permission action to SafeBrowsing servers. | 68 // Report permission action to SafeBrowsing servers. |
| 68 void ReportPermissionAction(const GURL& origin, | 69 void ReportPermissionAction(const GURL& origin, |
| 69 content::PermissionType permission, | 70 content::PermissionType permission, |
| 70 PermissionAction action, | 71 PermissionAction action, |
| 71 PermissionSourceUI source_ui, | 72 PermissionSourceUI source_ui, |
| 72 bool user_gesture); | 73 PermissionRequestGestureType gesture_type); |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, | 76 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, |
| 76 TestSafeBrowsingHitUrl); | 77 TestSafeBrowsingHitUrl); |
| 77 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, TestThreatDetailsUrl); | 78 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, TestThreatDetailsUrl); |
| 78 | 79 |
| 79 typedef std::set<const net::URLFetcher*> Reports; | 80 typedef std::set<const net::URLFetcher*> Reports; |
| 80 | 81 |
| 81 // Constructs a SafeBrowsingPingManager that issues network requests | 82 // Constructs a SafeBrowsingPingManager that issues network requests |
| 82 // using |request_context_getter|. | 83 // using |request_context_getter|. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 113 | 114 |
| 114 // Sends reports of permission actions. | 115 // Sends reports of permission actions. |
| 115 std::unique_ptr<PermissionReporter> permission_reporter_; | 116 std::unique_ptr<PermissionReporter> permission_reporter_; |
| 116 | 117 |
| 117 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager); | 118 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager); |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // namespace safe_browsing | 121 } // namespace safe_browsing |
| 121 | 122 |
| 122 #endif // CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ | 123 #endif // CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ |
| OLD | NEW |