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

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

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
Index: chrome/browser/download/trusted_sources_manager.cc
diff --git a/chrome/browser/download/trusted_sources_manager.cc b/chrome/browser/download/trusted_sources_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..67237bc2b8148aaca36175575313134291f247bd
--- /dev/null
+++ b/chrome/browser/download/trusted_sources_manager.cc
@@ -0,0 +1,21 @@
+// 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.
+
+#include "chrome/browser/download/trusted_sources_manager.h"
+
+#include "base/command_line.h"
+#include "chrome/common/chrome_switches.h"
+
+TrustedSourcesManager::TrustedSourcesManager() {
+ base::CommandLine* command_line(base::CommandLine::ForCurrentProcess());
+ DCHECK(command_line);
+ rules_.ParseFromString(
+ command_line->GetSwitchValueASCII(switches::kTrustedDownloadSources));
+}
+
+TrustedSourcesManager::~TrustedSourcesManager() = default;
+
+bool TrustedSourcesManager::IsFromTrustedSource(const GURL& url) const {
+ return rules_.Matches(url);
+}
« no previous file with comments | « chrome/browser/download/trusted_sources_manager.h ('k') | chrome/browser/download/trusted_sources_manager_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698