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 // The Safe Browsing service is responsible for downloading anti-phishing and | 5 // The Safe Browsing service is responsible for downloading anti-phishing and |
6 // anti-malware tables and checking urls against them. | 6 // anti-malware tables and checking urls against them. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
9 #define CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 // on IO thread. If shutdown is true, the manager is disabled permanently. | 63 // on IO thread. If shutdown is true, the manager is disabled permanently. |
64 void StopOnIOThread(bool shutdown) override; | 64 void StopOnIOThread(bool shutdown) override; |
65 | 65 |
66 // Called on the IO thread by the ThreatDetails with the serialized | 66 // Called on the IO thread by the ThreatDetails with the serialized |
67 // protocol buffer, so the service can send it over. | 67 // protocol buffer, so the service can send it over. |
68 void SendSerializedThreatDetails(const std::string& serialized) override; | 68 void SendSerializedThreatDetails(const std::string& serialized) override; |
69 | 69 |
70 // Report hits to the unsafe contents (malware, phishing, unsafe download URL) | 70 // Report hits to the unsafe contents (malware, phishing, unsafe download URL) |
71 // to the server. Can only be called on UI thread. If |post_data| is | 71 // to the server. Can only be called on UI thread. If |post_data| is |
72 // non-empty, the request will be sent as a POST instead of a GET. | 72 // non-empty, the request will be sent as a POST instead of a GET. |
73 // Will report only for UMA || is_extended_reporting. | 73 // Will report only for UMA || is_extended_reporting. |
Jialiu Lin
2017/05/18 22:32:12
You can remove the last line of this comments, sin
mortonm
2017/05/19 20:21:03
Done.
| |
74 void MaybeReportSafeBrowsingHit( | 74 void MaybeReportSafeBrowsingHit(const safe_browsing::HitReport& hit_report, |
75 const safe_browsing::HitReport& hit_report) override; | 75 content::WebContents* web_contents) override; |
76 | |
77 // Helper method to ensure hit reports are only sent when the user has | |
78 // opted in to extended reporting and is not currently in incognito mode. | |
79 static bool ShouldSendHitReport(const HitReport& hit_report, | |
Jialiu Lin
2017/05/18 22:32:12
How about moving this to protected session?
mortonm
2017/05/19 20:21:03
Done.
| |
80 content::WebContents* web_contents); | |
76 | 81 |
77 // Report permission action to SafeBrowsing servers. Can only be called on UI | 82 // Report permission action to SafeBrowsing servers. Can only be called on UI |
78 // thread. | 83 // thread. |
79 void ReportPermissionAction(const PermissionReportInfo& report_info); | 84 void ReportPermissionAction(const PermissionReportInfo& report_info); |
80 | 85 |
81 // Creates the whitelist URL set for tests that create a blocking page | 86 // Creates the whitelist URL set for tests that create a blocking page |
82 // themselves and then simulate OnBlockingPageDone(). OnBlockingPageDone() | 87 // themselves and then simulate OnBlockingPageDone(). OnBlockingPageDone() |
83 // expects the whitelist to exist, but the tests don't necessarily call | 88 // expects the whitelist to exist, but the tests don't necessarily call |
84 // DisplayBlockingPage(), which creates it. | 89 // DisplayBlockingPage(), which creates it. |
85 static void CreateWhitelistForTesting(content::WebContents* web_contents); | 90 static void CreateWhitelistForTesting(content::WebContents* web_contents); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 scoped_refptr<SafeBrowsingService> sb_service_; | 128 scoped_refptr<SafeBrowsingService> sb_service_; |
124 | 129 |
125 base::ObserverList<Observer> observer_list_; | 130 base::ObserverList<Observer> observer_list_; |
126 | 131 |
127 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); | 132 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); |
128 }; | 133 }; |
129 | 134 |
130 } // namespace safe_browsing | 135 } // namespace safe_browsing |
131 | 136 |
132 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 137 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
OLD | NEW |