| Index: android_webview/renderer/aw_content_renderer_client.cc
|
| diff --git a/android_webview/renderer/aw_content_renderer_client.cc b/android_webview/renderer/aw_content_renderer_client.cc
|
| index 7203f90a47cf216fcb459e9f90f5696c408d2dac..a59da63cd8c51e05e5da3e7f09ac171894d63ca9 100644
|
| --- a/android_webview/renderer/aw_content_renderer_client.cc
|
| +++ b/android_webview/renderer/aw_content_renderer_client.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <vector>
|
|
|
| +#include "android_webview/browser/aw_browser_context.h"
|
| #include "android_webview/common/aw_resource.h"
|
| #include "android_webview/common/aw_switches.h"
|
| #include "android_webview/common/render_view_messages.h"
|
| @@ -28,6 +29,8 @@
|
| #include "components/autofill/content/renderer/password_autofill_agent.h"
|
| #include "components/printing/renderer/print_web_view_helper.h"
|
| #include "components/visitedlink/renderer/visitedlink_slave.h"
|
| +#include "components/web_restriction/web_restriction_gin_wrapper.h"
|
| +#include "components/web_restriction/web_restriction_provider.h"
|
| #include "content/public/common/url_constants.h"
|
| #include "content/public/renderer/document_state.h"
|
| #include "content/public/renderer/navigation_state.h"
|
| @@ -175,7 +178,7 @@ bool AwContentRendererClient::HasErrorPage(int http_status_code,
|
| }
|
|
|
| void AwContentRendererClient::GetNavigationErrorStrings(
|
| - content::RenderFrame* /* render_frame */,
|
| + content::RenderFrame* render_frame,
|
| const blink::WebURLRequest& failed_request,
|
| const blink::WebURLError& error,
|
| std::string* error_html,
|
| @@ -207,6 +210,15 @@ void AwContentRendererClient::GetNavigationErrorStrings(
|
| ResourceBundle::GetSharedInstance().GetRawDataResource(
|
| IDR_AW_LOAD_ERROR_HTML),
|
| replacements, nullptr);
|
| + if (error.reason == net::ERR_BLOCKED_BY_ADMINISTRATOR) {
|
| + // Move to aw/common/ if chrome's solution is too complicated
|
| + auto web_restriction_provider =
|
| + AwBrowserContext::GetDefault()->GetWebRestrictionProvider();
|
| + if (web_restriction_provider->SupportsCustomErrorPage())
|
| + *error_html = web_restriction_provider->GetErrorHtml();
|
| + if (web_restriction_provider->SupportsRequest())
|
| + web_restriction::WebRestrictionGinWrapper::Install(render_frame);
|
| + }
|
| }
|
| if (error_description) {
|
| if (error.localizedDescription.isEmpty())
|
|
|