| 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 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/sequenced_task_runner_helpers.h" | 19 #include "base/sequenced_task_runner_helpers.h" |
| 20 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 20 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 24 | 24 |
| 25 class PrefChangeRegistrar; | 25 class PrefChangeRegistrar; |
| 26 class PrefService; | 26 class PrefService; |
| 27 class Profile; |
| 27 struct SafeBrowsingProtocolConfig; | 28 struct SafeBrowsingProtocolConfig; |
| 28 class SafeBrowsingDatabaseManager; | 29 class SafeBrowsingDatabaseManager; |
| 29 class SafeBrowsingPingManager; | 30 class SafeBrowsingPingManager; |
| 30 class SafeBrowsingProtocolManager; | 31 class SafeBrowsingProtocolManager; |
| 31 class SafeBrowsingServiceFactory; | 32 class SafeBrowsingServiceFactory; |
| 32 class SafeBrowsingUIManager; | 33 class SafeBrowsingUIManager; |
| 33 class SafeBrowsingURLRequestContextGetter; | 34 class SafeBrowsingURLRequestContextGetter; |
| 34 class TrackedPreferenceValidationDelegate; | 35 class TrackedPreferenceValidationDelegate; |
| 35 | 36 |
| 36 namespace base { | 37 namespace base { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const scoped_refptr<SafeBrowsingUIManager>& ui_manager() const; | 113 const scoped_refptr<SafeBrowsingUIManager>& ui_manager() const; |
| 113 | 114 |
| 114 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager() const; | 115 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager() const; |
| 115 | 116 |
| 116 SafeBrowsingProtocolManager* protocol_manager() const; | 117 SafeBrowsingProtocolManager* protocol_manager() const; |
| 117 | 118 |
| 118 SafeBrowsingPingManager* ping_manager() const; | 119 SafeBrowsingPingManager* ping_manager() const; |
| 119 | 120 |
| 120 // Returns a preference validation delegate that adds incidents to the | 121 // Returns a preference validation delegate that adds incidents to the |
| 121 // incident reporting service for validation failures. Returns NULL if the | 122 // incident reporting service for validation failures. Returns NULL if the |
| 122 // service is not applicable. | 123 // service is not applicable for the given profile. |
| 123 scoped_ptr<TrackedPreferenceValidationDelegate> | 124 scoped_ptr<TrackedPreferenceValidationDelegate> |
| 124 CreatePreferenceValidationDelegate() const; | 125 CreatePreferenceValidationDelegate(Profile* profile) const; |
| 125 | 126 |
| 126 protected: | 127 protected: |
| 127 // Creates the safe browsing service. Need to initialize before using. | 128 // Creates the safe browsing service. Need to initialize before using. |
| 128 SafeBrowsingService(); | 129 SafeBrowsingService(); |
| 129 | 130 |
| 130 virtual ~SafeBrowsingService(); | 131 virtual ~SafeBrowsingService(); |
| 131 | 132 |
| 132 virtual SafeBrowsingDatabaseManager* CreateDatabaseManager(); | 133 virtual SafeBrowsingDatabaseManager* CreateDatabaseManager(); |
| 133 | 134 |
| 134 virtual SafeBrowsingUIManager* CreateUIManager(); | 135 virtual SafeBrowsingUIManager* CreateUIManager(); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 class SafeBrowsingServiceFactory { | 243 class SafeBrowsingServiceFactory { |
| 243 public: | 244 public: |
| 244 SafeBrowsingServiceFactory() { } | 245 SafeBrowsingServiceFactory() { } |
| 245 virtual ~SafeBrowsingServiceFactory() { } | 246 virtual ~SafeBrowsingServiceFactory() { } |
| 246 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 247 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
| 247 private: | 248 private: |
| 248 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 249 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
| 249 }; | 250 }; |
| 250 | 251 |
| 251 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 252 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
| OLD | NEW |