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_SAFE_BROWSING_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class URLRequest; | 42 class URLRequest; |
43 class URLRequestContextGetter; | 43 class URLRequestContextGetter; |
44 } | 44 } |
45 | 45 |
46 namespace safe_browsing { | 46 namespace safe_browsing { |
47 class ClientSideDetectionService; | 47 class ClientSideDetectionService; |
48 class DownloadProtectionService; | 48 class DownloadProtectionService; |
49 struct ResourceRequestInfo; | 49 struct ResourceRequestInfo; |
50 struct SafeBrowsingProtocolConfig; | 50 struct SafeBrowsingProtocolConfig; |
51 class SafeBrowsingDatabaseManager; | 51 class SafeBrowsingDatabaseManager; |
| 52 class SafeBrowsingNavigationObserverManager; |
52 class SafeBrowsingPingManager; | 53 class SafeBrowsingPingManager; |
53 class SafeBrowsingProtocolManager; | 54 class SafeBrowsingProtocolManager; |
54 class SafeBrowsingProtocolManagerDelegate; | 55 class SafeBrowsingProtocolManagerDelegate; |
55 class SafeBrowsingServiceFactory; | 56 class SafeBrowsingServiceFactory; |
56 class SafeBrowsingUIManager; | 57 class SafeBrowsingUIManager; |
57 class SafeBrowsingURLRequestContextGetter; | 58 class SafeBrowsingURLRequestContextGetter; |
58 struct V4ProtocolConfig; | 59 struct V4ProtocolConfig; |
59 | 60 |
60 // Construction needs to happen on the main thread. | 61 // Construction needs to happen on the main thread. |
61 // The SafeBrowsingService owns both the UI and Database managers which do | 62 // The SafeBrowsingService owns both the UI and Database managers which do |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 123 } |
123 | 124 |
124 net::URLRequestContextGetter* url_request_context(); | 125 net::URLRequestContextGetter* url_request_context(); |
125 | 126 |
126 const scoped_refptr<SafeBrowsingUIManager>& ui_manager() const; | 127 const scoped_refptr<SafeBrowsingUIManager>& ui_manager() const; |
127 | 128 |
128 // This returns either the v3 or the v4 database manager, depending on | 129 // This returns either the v3 or the v4 database manager, depending on |
129 // the experiment settings. | 130 // the experiment settings. |
130 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager() const; | 131 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager() const; |
131 | 132 |
| 133 scoped_refptr<SafeBrowsingNavigationObserverManager> |
| 134 navigation_observer_manager(); |
| 135 |
132 SafeBrowsingProtocolManager* protocol_manager() const; | 136 SafeBrowsingProtocolManager* protocol_manager() const; |
133 | 137 |
134 SafeBrowsingPingManager* ping_manager() const; | 138 SafeBrowsingPingManager* ping_manager() const; |
135 | 139 |
136 // This may be NULL if v4 is not enabled by experiment. | 140 // This may be NULL if v4 is not enabled by experiment. |
137 const scoped_refptr<SafeBrowsingDatabaseManager>& v4_local_database_manager() | 141 const scoped_refptr<SafeBrowsingDatabaseManager>& v4_local_database_manager() |
138 const; | 142 const; |
139 | 143 |
140 // Returns a preference validation delegate that adds incidents to the | 144 // Returns a preference validation delegate that adds incidents to the |
141 // incident reporting service for validation failures. Returns NULL if the | 145 // incident reporting service for validation failures. Returns NULL if the |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 base::CallbackList<void(void)> state_callback_list_; | 288 base::CallbackList<void(void)> state_callback_list_; |
285 | 289 |
286 // The UI manager handles showing interstitials. Accessed on both UI and IO | 290 // The UI manager handles showing interstitials. Accessed on both UI and IO |
287 // thread. | 291 // thread. |
288 scoped_refptr<SafeBrowsingUIManager> ui_manager_; | 292 scoped_refptr<SafeBrowsingUIManager> ui_manager_; |
289 | 293 |
290 // The database manager handles the database and download logic. Accessed on | 294 // The database manager handles the database and download logic. Accessed on |
291 // both UI and IO thread. | 295 // both UI and IO thread. |
292 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; | 296 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; |
293 | 297 |
| 298 // The navigation observer manager handles download attribution. |
| 299 scoped_refptr<SafeBrowsingNavigationObserverManager> |
| 300 navigation_observer_manager_; |
| 301 |
294 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); | 302 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); |
295 }; | 303 }; |
296 | 304 |
297 // Factory for creating SafeBrowsingService. Useful for tests. | 305 // Factory for creating SafeBrowsingService. Useful for tests. |
298 class SafeBrowsingServiceFactory { | 306 class SafeBrowsingServiceFactory { |
299 public: | 307 public: |
300 SafeBrowsingServiceFactory() { } | 308 SafeBrowsingServiceFactory() { } |
301 virtual ~SafeBrowsingServiceFactory() { } | 309 virtual ~SafeBrowsingServiceFactory() { } |
302 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 310 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
303 private: | 311 private: |
304 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 312 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
305 }; | 313 }; |
306 | 314 |
307 } // namespace safe_browsing | 315 } // namespace safe_browsing |
308 | 316 |
309 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 317 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
OLD | NEW |