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

Unified Diff: chrome/browser/supervised_user/supervised_user_url_filter.cc

Issue 537993002: Supervised users: Prototype of static client-side host blacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: experimental Created 6 years, 3 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/supervised_user/supervised_user_url_filter.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_url_filter.cc
diff --git a/chrome/browser/supervised_user/supervised_user_url_filter.cc b/chrome/browser/supervised_user/supervised_user_url_filter.cc
index b1a98f18085af44590d35631054168f44b5c75f0..6f0fb76369b65b9eb84b288e6b09852825efa213 100644
--- a/chrome/browser/supervised_user/supervised_user_url_filter.cc
+++ b/chrome/browser/supervised_user/supervised_user_url_filter.cc
@@ -13,6 +13,7 @@
#include "base/strings/string_util.h"
#include "base/task_runner_util.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "chrome/browser/supervised_user/experimental/supervised_user_blacklist.h"
#include "components/policy/core/browser/url_blacklist_manager.h"
#include "components/url_fixer/url_fixer.h"
#include "components/url_matcher/url_matcher.h"
@@ -177,7 +178,8 @@ LoadWhitelistsOnBlockingPoolThread(
SupervisedUserURLFilter::SupervisedUserURLFilter()
: default_behavior_(ALLOW),
- contents_(new Contents()) {
+ contents_(new Contents()),
+ blacklist_(NULL) {
// Detach from the current thread so we can be constructed on a different
// thread than the one where we're used.
DetachFromThread();
@@ -288,6 +290,9 @@ SupervisedUserURLFilter::GetFilteringBehaviorForURL(const GURL& url) const {
}
}
+ if (blacklist_ && blacklist_->HasURL(url))
+ return BLOCK;
+
// If the default behavior is to allow, we don't need to check anything else.
if (default_behavior_ == ALLOW)
return ALLOW;
@@ -350,6 +355,11 @@ void SupervisedUserURLFilter::LoadWhitelists(
base::Bind(&SupervisedUserURLFilter::SetContents, this));
}
+void SupervisedUserURLFilter::SetBlacklist(
+ SupervisedUserBlacklist* blacklist) {
+ blacklist_ = blacklist;
+}
+
void SupervisedUserURLFilter::SetFromPatterns(
const std::vector<std::string>& patterns) {
DCHECK(CalledOnValidThread());
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_url_filter.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698