Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4421)

Unified Diff: chrome/browser/download/trusted_sources_manager.h

Issue 2943763002: Add a new group policy to disable safe browsing for files downloaded from trusted sources. (Closed)
Patch Set: Fix an XML goof Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_prefs.cc ('k') | chrome/browser/download/trusted_sources_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/trusted_sources_manager.h
diff --git a/chrome/browser/download/trusted_sources_manager.h b/chrome/browser/download/trusted_sources_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..62f584b64be08c3cb5458461fc601983c63a5015
--- /dev/null
+++ b/chrome/browser/download/trusted_sources_manager.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DOWNLOAD_TRUSTED_SOURCES_MANAGER_H_
+#define CHROME_BROWSER_DOWNLOAD_TRUSTED_SOURCES_MANAGER_H_
+
+#include "base/macros.h"
+#include "net/proxy/proxy_bypass_rules.h"
+
+class GURL;
+
+// Identifies if a URL is from a trusted source.
+class TrustedSourcesManager {
+ public:
+ virtual ~TrustedSourcesManager();
+
+ // Creates a platform-dependent instance of TrustedSourcesManager.
+ //
+ // A trusted sources manager has a list of sources that can be trusted with
+ // downloads, extracted from the kTrustedDownloadSources command line switch.
+ // An example usage is to specify that files downloaded from trusted sites
+ // don't need to be scanned by SafeBrowsing when the
+ // SafeBrowsingForTrustedSourcesEnabled policy is set to false.
+ //
+ // On creation the list of trusted sources is NULL.
+ //
+ // If the platform is Windows, the kTrustedDownloadSources value is ignored,
+ // the security zone mapping is used instead to determine whether the source
+ // is trusted or not.
+ //
+ static TrustedSourcesManager* Create();
+
+ // Returns true if the source of this URL is part of the trusted sources.
+ virtual bool IsFromTrustedSource(const GURL& url) const;
+
+ protected:
+ // Must use Create.
+ TrustedSourcesManager();
+
+ private:
+ // We are using ProxyBypassRules because they have the functionality that we
+ // want, but we are not using it for proxy bypass.
+ net::ProxyBypassRules rules_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrustedSourcesManager);
+};
+
+#endif // CHROME_BROWSER_DOWNLOAD_TRUSTED_SOURCES_MANAGER_H_
« no previous file with comments | « chrome/browser/download/download_prefs.cc ('k') | chrome/browser/download/trusted_sources_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698