OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_TRUSTED_SOURCES_MANAGER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_TRUSTED_SOURCES_MANAGER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "net/proxy/proxy_bypass_rules.h" |
| 10 |
| 11 class GURL; |
| 12 |
| 13 // Identifies if a URL is from a trusted source. |
| 14 class TrustedSourcesManager { |
| 15 public: |
| 16 virtual ~TrustedSourcesManager(); |
| 17 |
| 18 // Creates a platform-dependent instance of TrustedSourcesManager. |
| 19 // |
| 20 // A trusted sources manager has a list of sources that can be trusted with |
| 21 // downloads, extracted from the kTrustedDownloadSources command line switch. |
| 22 // An example usage is to specify that files downloaded from trusted sites |
| 23 // don't need to be scanned by SafeBrowsing when the |
| 24 // SafeBrowsingForTrustedSourcesEnabled policy is set to false. |
| 25 // |
| 26 // On creation the list of trusted sources is NULL. |
| 27 // |
| 28 // If the platform is Windows, the kTrustedDownloadSources value is ignored, |
| 29 // the security zone mapping is used instead to determine whether the source |
| 30 // is trusted or not. |
| 31 // |
| 32 static TrustedSourcesManager* Create(); |
| 33 |
| 34 // Returns true if the source of this URL is part of the trusted sources. |
| 35 virtual bool IsFromTrustedSource(const GURL& url) const; |
| 36 |
| 37 protected: |
| 38 // Must use Create. |
| 39 TrustedSourcesManager(); |
| 40 |
| 41 private: |
| 42 // We are using ProxyBypassRules because they have the functionality that we |
| 43 // want, but we are not using it for proxy bypass. |
| 44 net::ProxyBypassRules rules_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(TrustedSourcesManager); |
| 47 }; |
| 48 |
| 49 #endif // CHROME_BROWSER_DOWNLOAD_TRUSTED_SOURCES_MANAGER_H_ |
OLD | NEW |