| 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 e486795e92d6f3f49ba521c972d314cc457b6d0b..ed4fddf7d1e2ce92710171450798fc8f5db91b10 100644
|
| --- a/android_webview/renderer/aw_content_renderer_client.cc
|
| +++ b/android_webview/renderer/aw_content_renderer_client.cc
|
| @@ -27,7 +27,10 @@
|
| #include "components/autofill/content/renderer/autofill_agent.h"
|
| #include "components/autofill/content/renderer/password_autofill_agent.h"
|
| #include "components/printing/renderer/print_web_view_helper.h"
|
| +#include "components/supervised_user_error_page/gin_wrapper.h"
|
| +#include "components/supervised_user_error_page/supervised_user_error_page_android.h"
|
| #include "components/visitedlink/renderer/visitedlink_slave.h"
|
| +#include "components/web_restrictions/interfaces/web_restrictions.mojom.h"
|
| #include "content/public/common/url_constants.h"
|
| #include "content/public/renderer/document_state.h"
|
| #include "content/public/renderer/navigation_state.h"
|
| @@ -36,6 +39,7 @@
|
| #include "content/public/renderer/render_view.h"
|
| #include "net/base/escape.h"
|
| #include "net/base/net_errors.h"
|
| +#include "services/shell/public/cpp/interface_provider.h"
|
| #include "third_party/WebKit/public/platform/WebString.h"
|
| #include "third_party/WebKit/public/platform/WebURL.h"
|
| #include "third_party/WebKit/public/platform/WebURLError.h"
|
| @@ -167,14 +171,14 @@ 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,
|
| base::string16* error_description) {
|
| if (error_html) {
|
| - std::string url =
|
| - net::EscapeForHTML(GURL(failed_request.url()).possibly_invalid_spec());
|
| + GURL gurl(failed_request.url());
|
| + std::string url = net::EscapeForHTML(gurl.possibly_invalid_spec());
|
| std::string err =
|
| base::UTF16ToUTF8(base::StringPiece16(error.localizedDescription));
|
|
|
| @@ -199,6 +203,22 @@ void AwContentRendererClient::GetNavigationErrorStrings(
|
| ResourceBundle::GetSharedInstance().GetRawDataResource(
|
| IDR_AW_LOAD_ERROR_HTML),
|
| replacements, nullptr);
|
| + if (error.reason == net::ERR_BLOCKED_BY_ADMINISTRATOR) {
|
| + // This needs more information
|
| + render_frame->GetRemoteInterfaces()->GetInterface(
|
| + &web_restrictions_service_);
|
| + web_restrictions::mojom::ClientResultPtr result;
|
| + if (web_restrictions_service_->GetResult(mojo::String(url), &result)) {
|
| + std::string detailed_error_html =
|
| + supervised_user_error_page::BuildHtmlFromWebRestrictionsResult(
|
| + result, RenderThread::Get()->GetLocale());
|
| + if (!detailed_error_html.empty()) {
|
| + *error_html = detailed_error_html;
|
| + supervised_user_error_page::GinWrapper::InstallWhenFrameReady(
|
| + render_frame, url, web_restrictions_service_);
|
| + }
|
| + }
|
| + }
|
| }
|
| if (error_description) {
|
| if (error.localizedDescription.isEmpty())
|
|
|