OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TEST_DATABASE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "chrome/browser/safe_browsing/database_manager.h" | 12 #include "chrome/browser/safe_browsing/database_manager.h" |
13 | 13 |
14 // This is a non-pure-virtual implementation of the SafeBrowsingDatabaseManager | 14 // This is a non-pure-virtual implementation of the SafeBrowsingDatabaseManager |
15 // interface. It's used in tests by overriding only the functions that get | 15 // interface. It's used in tests by overriding only the functions that get |
16 // called, and it'll complain if you call one that isn't overriden. | 16 // called, and it'll complain if you call one that isn't overriden. |
17 class TestSafeBrowsingDatabaseManager | 17 class TestSafeBrowsingDatabaseManager |
18 : public SafeBrowsingDatabaseManager { | 18 : public SafeBrowsingDatabaseManager { |
19 public: | 19 public: |
20 // SafeBrowsingDatabaseManager implementation: | 20 // SafeBrowsingDatabaseManager implementation: |
| 21 bool IsSupported() const override; |
21 bool CanCheckUrl(const GURL& url) const override; | 22 bool CanCheckUrl(const GURL& url) const override; |
22 bool download_protection_enabled() const override; | 23 bool download_protection_enabled() const override; |
23 bool CheckBrowseUrl(const GURL& url, Client* client) override; | 24 bool CheckBrowseUrl(const GURL& url, Client* client) override; |
24 bool CheckDownloadUrl(const std::vector<GURL>& url_chain, | 25 bool CheckDownloadUrl(const std::vector<GURL>& url_chain, |
25 Client* client) override; | 26 Client* client) override; |
26 bool CheckExtensionIDs(const std::set<std::string>& extension_ids, | 27 bool CheckExtensionIDs(const std::set<std::string>& extension_ids, |
27 Client* client) override; | 28 Client* client) override; |
28 bool MatchCsdWhitelistUrl(const GURL& url) override; | 29 bool MatchCsdWhitelistUrl(const GURL& url) override; |
29 bool MatchMalwareIP(const std::string& ip_address) override; | 30 bool MatchMalwareIP(const std::string& ip_address) override; |
30 bool MatchDownloadWhitelistUrl(const GURL& url) override; | 31 bool MatchDownloadWhitelistUrl(const GURL& url) override; |
31 bool MatchDownloadWhitelistString(const std::string& str) override; | 32 bool MatchDownloadWhitelistString(const std::string& str) override; |
32 bool MatchInclusionWhitelistUrl(const GURL& url) override; | 33 bool MatchInclusionWhitelistUrl(const GURL& url) override; |
33 bool IsMalwareKillSwitchOn() override; | 34 bool IsMalwareKillSwitchOn() override; |
34 bool IsCsdWhitelistKillSwitchOn() override; | 35 bool IsCsdWhitelistKillSwitchOn() override; |
35 void CancelCheck(Client* client) override; | 36 void CancelCheck(Client* client) override; |
36 void StartOnIOThread() override; | 37 void StartOnIOThread() override; |
37 void StopOnIOThread(bool shutdown) override; | 38 void StopOnIOThread(bool shutdown) override; |
38 | 39 |
39 protected: | 40 protected: |
40 ~TestSafeBrowsingDatabaseManager() override {}; | 41 ~TestSafeBrowsingDatabaseManager() override {}; |
41 }; | 42 }; |
42 #endif // CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_ | 43 #endif // CHROME_BROWSER_SAFE_BROWSING_TEST_DATABASE_MANAGER_H_ |
OLD | NEW |