| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SERVICES_DELEGATE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" |
| 11 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 12 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 12 #include "chrome/browser/safe_browsing/download_protection_service.h" | 13 #include "chrome/browser/safe_browsing/download_protection_service.h" |
| 13 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" | 14 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" |
| 14 #include "chrome/browser/safe_browsing/incident_reporting/resource_request_detec
tor.h" | 15 #include "chrome/browser/safe_browsing/incident_reporting/resource_request_detec
tor.h" |
| 15 #include "chrome/browser/safe_browsing/services_delegate.h" | 16 #include "chrome/browser/safe_browsing/services_delegate.h" |
| 17 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" |
| 16 | 18 |
| 17 namespace safe_browsing { | 19 namespace safe_browsing { |
| 18 | 20 |
| 19 class SafeBrowsingDatabaseManager; | 21 class SafeBrowsingDatabaseManager; |
| 20 | 22 |
| 21 // Actual ServicesDelegate implementation. Create via | 23 // Actual ServicesDelegate implementation. Create via |
| 22 // ServicesDelegate::Create(). | 24 // ServicesDelegate::Create(). |
| 23 class ServicesDelegateImpl : public ServicesDelegate { | 25 class ServicesDelegateImpl : public ServicesDelegate { |
| 24 public: | 26 public: |
| 25 ServicesDelegateImpl(SafeBrowsingService* safe_browsing_service, | 27 ServicesDelegateImpl(SafeBrowsingService* safe_browsing_service, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 // estimation finds both Scout and legacy extended reporting to be enabled. | 56 // estimation finds both Scout and legacy extended reporting to be enabled. |
| 55 // This can happen, for instance, if one profile has Scout enabled and another | 57 // This can happen, for instance, if one profile has Scout enabled and another |
| 56 // has legacy extended reporting enabled. In such a case, this method reports | 58 // has legacy extended reporting enabled. In such a case, this method reports |
| 57 // LEGACY as the current level. | 59 // LEGACY as the current level. |
| 58 ExtendedReportingLevel GetEstimatedExtendedReportingLevel() const; | 60 ExtendedReportingLevel GetEstimatedExtendedReportingLevel() const; |
| 59 | 61 |
| 60 DownloadProtectionService* CreateDownloadProtectionService(); | 62 DownloadProtectionService* CreateDownloadProtectionService(); |
| 61 IncidentReportingService* CreateIncidentReportingService(); | 63 IncidentReportingService* CreateIncidentReportingService(); |
| 62 ResourceRequestDetector* CreateResourceRequestDetector(); | 64 ResourceRequestDetector* CreateResourceRequestDetector(); |
| 63 | 65 |
| 66 void CreatePasswordProtectionService(Profile* profile) override; |
| 67 void RemovePasswordProtectionService(Profile* profile) override; |
| 68 PasswordProtectionService* GetPasswordProtectionService( |
| 69 Profile* profile) const override; |
| 70 |
| 64 std::unique_ptr<ClientSideDetectionService> csd_service_; | 71 std::unique_ptr<ClientSideDetectionService> csd_service_; |
| 65 std::unique_ptr<DownloadProtectionService> download_service_; | 72 std::unique_ptr<DownloadProtectionService> download_service_; |
| 66 std::unique_ptr<IncidentReportingService> incident_service_; | 73 std::unique_ptr<IncidentReportingService> incident_service_; |
| 67 std::unique_ptr<ResourceRequestDetector> resource_request_detector_; | 74 std::unique_ptr<ResourceRequestDetector> resource_request_detector_; |
| 68 | 75 |
| 69 SafeBrowsingService* const safe_browsing_service_; | 76 SafeBrowsingService* const safe_browsing_service_; |
| 70 ServicesDelegate::ServicesCreator* const services_creator_; | 77 ServicesDelegate::ServicesCreator* const services_creator_; |
| 71 | 78 |
| 72 // The Pver4 local database manager handles the database and download logic | 79 // The Pver4 local database manager handles the database and download logic |
| 73 // Accessed on both UI and IO thread. | 80 // Accessed on both UI and IO thread. |
| 74 scoped_refptr<SafeBrowsingDatabaseManager> v4_local_database_manager_; | 81 scoped_refptr<SafeBrowsingDatabaseManager> v4_local_database_manager_; |
| 75 | 82 |
| 83 // Tracks existing Profiles, and their corresponding |
| 84 // ChromePasswordProtectionService instances. |
| 85 // Accessed on UI thread. |
| 86 std::map<Profile*, std::unique_ptr<ChromePasswordProtectionService>> |
| 87 password_protection_service_map_; |
| 88 |
| 76 DISALLOW_COPY_AND_ASSIGN(ServicesDelegateImpl); | 89 DISALLOW_COPY_AND_ASSIGN(ServicesDelegateImpl); |
| 77 }; | 90 }; |
| 78 | 91 |
| 79 } // namespace safe_browsing | 92 } // namespace safe_browsing |
| 80 | 93 |
| 81 #endif // CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ | 94 #endif // CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ |
| OLD | NEW |