| 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_DATABASE_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
| 9 #define CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Called when the result of checking a download URL is known. | 37 // Called when the result of checking a download URL is known. |
| 38 virtual void OnCheckDownloadUrlResult(const std::vector<GURL>& url_chain, | 38 virtual void OnCheckDownloadUrlResult(const std::vector<GURL>& url_chain, |
| 39 SBThreatType threat_type) {} | 39 SBThreatType threat_type) {} |
| 40 | 40 |
| 41 // Called when the result of checking a set of extensions is known. | 41 // Called when the result of checking a set of extensions is known. |
| 42 virtual void OnCheckExtensionsResult( | 42 virtual void OnCheckExtensionsResult( |
| 43 const std::set<std::string>& threats) {} | 43 const std::set<std::string>& threats) {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Returns true if URL-checking is supported on this build+device. |
| 47 // If false, calls to CheckBrowseUrl may dcheck-fail. |
| 48 virtual bool IsSupported() const = 0; |
| 49 |
| 46 // Returns true if the url's scheme can be checked. | 50 // Returns true if the url's scheme can be checked. |
| 47 virtual bool CanCheckUrl(const GURL& url) const = 0; | 51 virtual bool CanCheckUrl(const GURL& url) const = 0; |
| 48 | 52 |
| 49 // Returns whether download protection is enabled. | 53 // Returns whether download protection is enabled. |
| 50 virtual bool download_protection_enabled() const = 0; | 54 virtual bool download_protection_enabled() const = 0; |
| 51 | 55 |
| 52 // Called on the IO thread to check if the given url is safe or not. If we | 56 // Called on the IO thread to check if the given url is safe or not. If we |
| 53 // can synchronously determine that the url is safe, CheckUrl returns true. | 57 // can synchronously determine that the url is safe, CheckUrl returns true. |
| 54 // Otherwise it returns false, and "client" is called asynchronously with the | 58 // Otherwise it returns false, and "client" is called asynchronously with the |
| 55 // result when it is ready. | 59 // result when it is ready. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // on IO thread. If shutdown is true, the manager is disabled permanently. | 118 // on IO thread. If shutdown is true, the manager is disabled permanently. |
| 115 virtual void StopOnIOThread(bool shutdown) = 0; | 119 virtual void StopOnIOThread(bool shutdown) = 0; |
| 116 | 120 |
| 117 protected: | 121 protected: |
| 118 virtual ~SafeBrowsingDatabaseManager() {} | 122 virtual ~SafeBrowsingDatabaseManager() {} |
| 119 | 123 |
| 120 friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>; | 124 friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>; |
| 121 }; // class SafeBrowsingDatabaseManager | 125 }; // class SafeBrowsingDatabaseManager |
| 122 | 126 |
| 123 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ | 127 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
| OLD | NEW |