When an URL fails to load with HTTP Error 404, no error page
was displayed; only blank page was seen. This patch overrides
necessary functions to display the required error page.
Reference: https://review.tizen.org/gerrit/258954
Change-Id: I24f42ebd37e33e48a3998afdc891d329d34db831
Signed-off-by: Gajendra N <gajendra.n@samsung.com>
(cherry picked from commit
5877ed199a4a3e3185b935f5ced45581c2313781)
#include "browser/render_message_filter_efl.h"
#include "browser/web_view_browser_message_filter.h"
#include "common/content_switches_efl.h"
+#include "components/error_page/common/error.h"
+#include "components/error_page/common/localized_error.h"
#include "content/browser/web_contents/web_contents_view_efl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_widget_host.h"
target_url.spec().c_str());
}
+bool ContentBrowserClientEfl::HasErrorPage(int http_status_code) {
+ // Use an internal error page, if we have one for the status code.
+ return error_page::LocalizedError::HasStrings(
+ error_page::Error::kHttpErrorDomain, http_status_code);
+}
+
void ContentBrowserClientEfl::AllowCertificateError(
WebContents* web_contents,
int cert_error,
scoped_refptr<QuotaPermissionContext> CreateQuotaPermissionContext() override;
+ bool HasErrorPage(int http_status_code) override;
void AllowCertificateError(
WebContents* web_contents,
int cert_error,
content::CommonRendererClient::PrepareErrorPage(error, error_html);
}
+void ContentRendererClientEfl::PrepareErrorPageForHttpStatusError(
+ content::RenderFrame* render_frame,
+ const blink::WebURLError& error,
+ const std::string& http_method,
+ int http_status,
+ std::string* error_html) {
+ content::CommonRendererClient::PrepareErrorPage(error, error_html);
+}
+
void ContentRendererClientEfl::ApplyCustomMobileSettings(blink::WebView* webview) {
// blink::WebViewImpl prevents auto zoom after tap if maximum legible scale is
// too small. Blink by default sets it to 1 and needs to be enlarged to make
const blink::WebURLError& error,
const std::string& http_method,
std::string* error_html) override;
+ void PrepareErrorPageForHttpStatusError(
+ content::RenderFrame* render_frame,
+ const blink::WebURLError& error,
+ const std::string& http_method,
+ int http_status,
+ std::string* error_html) override;
uint64_t VisitedLinkHash(const char* canonical_url, size_t length) override;