blob: 4b6efec2653efd5af10f6399a5b3e5dcd8fe7e3a [file] [log] [blame]
// 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);
matcher_ = net::SchemeHostPortMatcher::FromRawString(
command_line->GetSwitchValueASCII(switches::kTrustedDownloadSources));
}
TrustedSourcesManager::~TrustedSourcesManager() = default;
bool TrustedSourcesManager::IsFromTrustedSource(const GURL& url) const {
return matcher_.Includes(url);
}