| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 namespace prefs { | 47 namespace prefs { |
| 48 namespace mojom { | 48 namespace mojom { |
| 49 class TrackedPreferenceValidationDelegate; | 49 class TrackedPreferenceValidationDelegate; |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 namespace safe_browsing { | 53 namespace safe_browsing { |
| 54 class ClientSideDetectionService; | 54 class ClientSideDetectionService; |
| 55 class DownloadProtectionService; | 55 class DownloadProtectionService; |
| 56 class PasswordProtectionService; | 56 class PasswordProtectionService; |
| 57 class ChromePasswordProtectionService; | |
| 58 struct ResourceRequestInfo; | 57 struct ResourceRequestInfo; |
| 59 struct SafeBrowsingProtocolConfig; | 58 struct SafeBrowsingProtocolConfig; |
| 60 class SafeBrowsingDatabaseManager; | 59 class SafeBrowsingDatabaseManager; |
| 61 class SafeBrowsingNavigationObserverManager; | 60 class SafeBrowsingNavigationObserverManager; |
| 62 class SafeBrowsingPingManager; | 61 class SafeBrowsingPingManager; |
| 63 class SafeBrowsingProtocolManager; | 62 class SafeBrowsingProtocolManager; |
| 64 class SafeBrowsingProtocolManagerDelegate; | 63 class SafeBrowsingProtocolManagerDelegate; |
| 65 class SafeBrowsingServiceFactory; | 64 class SafeBrowsingServiceFactory; |
| 66 class SafeBrowsingUIManager; | 65 class SafeBrowsingUIManager; |
| 67 class SafeBrowsingURLRequestContextGetter; | 66 class SafeBrowsingURLRequestContextGetter; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 274 |
| 276 // Checks if any profile is currently using the safe browsing service, and | 275 // Checks if any profile is currently using the safe browsing service, and |
| 277 // starts or stops the service accordingly. | 276 // starts or stops the service accordingly. |
| 278 void RefreshState(); | 277 void RefreshState(); |
| 279 | 278 |
| 280 void OnSendSerializedDownloadReport(const std::string& report); | 279 void OnSendSerializedDownloadReport(const std::string& report); |
| 281 | 280 |
| 282 // Process the observed resource requests on the UI thread. | 281 // Process the observed resource requests on the UI thread. |
| 283 void ProcessResourceRequest(const ResourceRequestInfo& request); | 282 void ProcessResourceRequest(const ResourceRequestInfo& request); |
| 284 | 283 |
| 285 void CreatePasswordProtectionService(Profile* profile); | |
| 286 | |
| 287 void RemovePasswordProtectionService(Profile* profile); | |
| 288 | |
| 289 void CreateTriggerManager(); | 284 void CreateTriggerManager(); |
| 290 | 285 |
| 291 // The factory used to instantiate a SafeBrowsingService object. | 286 // The factory used to instantiate a SafeBrowsingService object. |
| 292 // Useful for tests, so they can provide their own implementation of | 287 // Useful for tests, so they can provide their own implementation of |
| 293 // SafeBrowsingService. | 288 // SafeBrowsingService. |
| 294 static SafeBrowsingServiceFactory* factory_; | 289 static SafeBrowsingServiceFactory* factory_; |
| 295 | 290 |
| 296 // The SafeBrowsingURLRequestContextGetter used to access | 291 // The SafeBrowsingURLRequestContextGetter used to access |
| 297 // |url_request_context_|. Accessed on UI thread. | 292 // |url_request_context_|. Accessed on UI thread. |
| 298 scoped_refptr<SafeBrowsingURLRequestContextGetter> | 293 scoped_refptr<SafeBrowsingURLRequestContextGetter> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 345 |
| 351 // The database manager handles the database and download logic. Accessed on | 346 // The database manager handles the database and download logic. Accessed on |
| 352 // both UI and IO thread. | 347 // both UI and IO thread. |
| 353 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; | 348 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; |
| 354 | 349 |
| 355 // The navigation observer manager handles attribution of safe browsing | 350 // The navigation observer manager handles attribution of safe browsing |
| 356 // events. | 351 // events. |
| 357 scoped_refptr<SafeBrowsingNavigationObserverManager> | 352 scoped_refptr<SafeBrowsingNavigationObserverManager> |
| 358 navigation_observer_manager_; | 353 navigation_observer_manager_; |
| 359 | 354 |
| 360 // Tracks existing Profiles, and their corresponding | |
| 361 // ChromePasswordProtectionService instances. | |
| 362 // Accessed on UI thread. | |
| 363 std::map<Profile*, std::unique_ptr<ChromePasswordProtectionService>> | |
| 364 password_protection_service_map_; | |
| 365 | |
| 366 std::unique_ptr<TriggerManager> trigger_manager_; | 355 std::unique_ptr<TriggerManager> trigger_manager_; |
| 367 | 356 |
| 368 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); | 357 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); |
| 369 }; | 358 }; |
| 370 | 359 |
| 371 // Factory for creating SafeBrowsingService. Useful for tests. | 360 // Factory for creating SafeBrowsingService. Useful for tests. |
| 372 class SafeBrowsingServiceFactory { | 361 class SafeBrowsingServiceFactory { |
| 373 public: | 362 public: |
| 374 SafeBrowsingServiceFactory() { } | 363 SafeBrowsingServiceFactory() { } |
| 375 virtual ~SafeBrowsingServiceFactory() { } | 364 virtual ~SafeBrowsingServiceFactory() { } |
| 376 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 365 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
| 377 private: | 366 private: |
| 378 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 367 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
| 379 }; | 368 }; |
| 380 | 369 |
| 381 } // namespace safe_browsing | 370 } // namespace safe_browsing |
| 382 | 371 |
| 383 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 372 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
| OLD | NEW |