@Override
    public void onReceivedHttpError(
        WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {

      Snackbar.make(rootView, errorResponse.getReasonPhrase(), Snackbar.LENGTH_INDEFINITE)
          .setAction(
              "Reload",
              new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                  loadWebUrl(urlToLoad);
                }
              })
          .show();

      super.onReceivedHttpError(view, request, errorResponse);
    }
  /** @see AwContentsClient#shouldInterceptRequest(java.lang.String) */
  @Override
  public AwWebResourceResponse shouldInterceptRequest(ShouldInterceptRequestParams params) {
    TraceEvent.begin();
    if (TRACE) Log.d(TAG, "shouldInterceptRequest=" + params.url);
    WebResourceResponse response =
        mWebViewClient.shouldInterceptRequest(mWebView, new WebResourceRequestImpl(params));
    TraceEvent.end();
    if (response == null) return null;

    // AwWebResourceResponse should support null headers. b/16332774.
    Map<String, String> responseHeaders = response.getResponseHeaders();
    if (responseHeaders == null) responseHeaders = new HashMap<String, String>();

    return new AwWebResourceResponse(
        response.getMimeType(),
        response.getEncoding(),
        response.getData(),
        response.getStatusCode(),
        response.getReasonPhrase(),
        responseHeaders);
  }