Allow for different error codes to be sent by the policy infrastructure.
Needed for proper error messaging of the case when navigation is blocked before
forced enrollment check completion.
Second stage will be to add a new error message for that.
BUG=360562
TEST=unit tests.
Review URL: https://codereview.chromium.org/227683002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262375 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 64681ed..63a6951 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -474,14 +474,15 @@
// TODO(joaodasilva): This prevents extensions from seeing URLs that are
// blocked. However, an extension might redirect the request to another URL,
// which is not blocked.
+ int error = net::ERR_BLOCKED_BY_ADMINISTRATOR;
if (url_blacklist_manager_ &&
- url_blacklist_manager_->IsRequestBlocked(*request)) {
+ url_blacklist_manager_->IsRequestBlocked(*request, &error)) {
// URL access blocked by policy.
request->net_log().AddEvent(
net::NetLog::TYPE_CHROME_POLICY_ABORTED_REQUEST,
net::NetLog::StringCallback("url",
&request->url().possibly_invalid_spec()));
- return net::ERR_BLOCKED_BY_ADMINISTRATOR;
+ return error;
}
#endif