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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // be called on UI thread. | 155 // be called on UI thread. |
156 void ReportInvalidCertificateChain(const std::string& serialized_report, | 156 void ReportInvalidCertificateChain(const std::string& serialized_report, |
157 const base::Closure& callback); | 157 const base::Closure& callback); |
158 | 158 |
159 // Report permission action to SafeBrowsing servers. Can only be called on UI | 159 // Report permission action to SafeBrowsing servers. Can only be called on UI |
160 // thread. | 160 // thread. |
161 void ReportPermissionAction(const GURL& origin, | 161 void ReportPermissionAction(const GURL& origin, |
162 content::PermissionType permission, | 162 content::PermissionType permission, |
163 PermissionAction action, | 163 PermissionAction action, |
164 PermissionSourceUI source_ui, | 164 PermissionSourceUI source_ui, |
165 PermissionRequestGestureType gesture_type); | 165 PermissionRequestGestureType gesture_type, |
| 166 int num_prior_dismissals, |
| 167 int num_prior_ignores); |
166 | 168 |
167 // Add and remove observers. These methods must be invoked on the UI thread. | 169 // Add and remove observers. These methods must be invoked on the UI thread. |
168 void AddObserver(Observer* observer); | 170 void AddObserver(Observer* observer); |
169 void RemoveObserver(Observer* remove); | 171 void RemoveObserver(Observer* remove); |
170 | 172 |
171 protected: | 173 protected: |
172 virtual ~SafeBrowsingUIManager(); | 174 virtual ~SafeBrowsingUIManager(); |
173 | 175 |
174 private: | 176 private: |
175 friend class base::RefCountedThreadSafe<SafeBrowsingUIManager>; | 177 friend class base::RefCountedThreadSafe<SafeBrowsingUIManager>; |
176 friend class SafeBrowsingUIManagerTest; | 178 friend class SafeBrowsingUIManagerTest; |
177 friend class TestSafeBrowsingUIManager; | 179 friend class TestSafeBrowsingUIManager; |
178 | 180 |
179 // Call protocol manager on IO thread to report hits of unsafe contents. | 181 // Call protocol manager on IO thread to report hits of unsafe contents. |
180 void ReportSafeBrowsingHitOnIOThread( | 182 void ReportSafeBrowsingHitOnIOThread( |
181 const safe_browsing::HitReport& hit_report); | 183 const safe_browsing::HitReport& hit_report); |
182 | 184 |
183 // Sends an invalid certificate chain report over the network. | 185 // Sends an invalid certificate chain report over the network. |
184 void ReportInvalidCertificateChainOnIOThread( | 186 void ReportInvalidCertificateChainOnIOThread( |
185 const std::string& serialized_report); | 187 const std::string& serialized_report); |
186 | 188 |
187 // Report permission action to SafeBrowsing servers. | 189 // Report permission action to SafeBrowsing servers. |
188 void ReportPermissionActionOnIOThread( | 190 void ReportPermissionActionOnIOThread( |
189 const GURL& origin, | 191 const GURL& origin, |
190 content::PermissionType permission, | 192 content::PermissionType permission, |
191 PermissionAction action, | 193 PermissionAction action, |
192 PermissionSourceUI source_ui, | 194 PermissionSourceUI source_ui, |
193 PermissionRequestGestureType gesture_type); | 195 PermissionRequestGestureType gesture_type, |
| 196 int num_prior_dismissals, |
| 197 int num_prior_ignores); |
194 | 198 |
195 // Updates the whitelist state. Called on the UI thread. | 199 // Updates the whitelist state. Called on the UI thread. |
196 void AddToWhitelist(const UnsafeResource& resource); | 200 void AddToWhitelist(const UnsafeResource& resource); |
197 | 201 |
198 // Safebrowsing service. | 202 // Safebrowsing service. |
199 scoped_refptr<SafeBrowsingService> sb_service_; | 203 scoped_refptr<SafeBrowsingService> sb_service_; |
200 | 204 |
201 base::ObserverList<Observer> observer_list_; | 205 base::ObserverList<Observer> observer_list_; |
202 | 206 |
203 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); | 207 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); |
204 }; | 208 }; |
205 | 209 |
206 } // namespace safe_browsing | 210 } // namespace safe_browsing |
207 | 211 |
208 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ | 212 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ |
OLD | NEW |