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

Unified Diff: chrome/browser/managed_mode/managed_mode_url_filter.cc

Issue 110643005: Refactored the URLBlacklistManager to avoid chrome/ and content/ dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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 | « no previous file | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/managed_mode/managed_mode_url_filter.cc
diff --git a/chrome/browser/managed_mode/managed_mode_url_filter.cc b/chrome/browser/managed_mode/managed_mode_url_filter.cc
index d60255f5ecb4eebc1df341d40089ff4b7460189a..48bf14f1489d6a7d70d7757ab1bd79442fa53a14 100644
--- a/chrome/browser/managed_mode/managed_mode_url_filter.cc
+++ b/chrome/browser/managed_mode/managed_mode_url_filter.cc
@@ -14,6 +14,7 @@
#include "base/task_runner_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/policy/url_blacklist_manager.h"
+#include "chrome/common/net/url_fixer_upper.h"
#include "components/url_matcher/url_matcher.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -23,6 +24,7 @@ using content::BrowserThread;
using net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES;
using net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES;
using net::registry_controlled_domains::GetRegistryLength;
+using policy::URLBlacklist;
using url_matcher::URLMatcher;
using url_matcher::URLMatcherConditionSet;
@@ -87,14 +89,16 @@ bool FilterBuilder::AddPattern(const std::string& pattern, int site_id) {
uint16 port;
std::string path;
bool match_subdomains = true;
- if (!policy::URLBlacklist::FilterToComponents(
- pattern, &scheme, &host, &match_subdomains, &port, &path)) {
+ URLBlacklist::SegmentURLCallback callback =
+ static_cast<URLBlacklist::SegmentURLCallback>(URLFixerUpper::SegmentURL);
+ if (!URLBlacklist::FilterToComponents(
+ callback, pattern, &scheme, &host, &match_subdomains, &port, &path)) {
LOG(ERROR) << "Invalid pattern " << pattern;
return false;
}
scoped_refptr<URLMatcherConditionSet> condition_set =
- policy::URLBlacklist::CreateConditionSet(
+ URLBlacklist::CreateConditionSet(
&contents_->url_matcher, ++matcher_id_,
scheme, host, match_subdomains, port, path);
all_conditions_.push_back(condition_set);
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698