From 32fffe6b2f8a5e44b6f8d3056104c2010726037c Mon Sep 17 00:00:00 2001 From: Adam Kallai Date: Wed, 27 Nov 2013 08:52:34 -0800 Subject: Implement DidFailProvisionalLoad function The WebContentObserver::DidFailLoad event doesn't handle all of the errors during the web content loading (eg. network errors). Thus WebContentObserver::DidFailProvisionalLoad should be binded on Qt side to handle these errors too. This event is handled by the WebContentsDelegateQt::DidFailLoad function now. Change-Id: I1421214dd94481a1e27cda8d35a35d418289b604 Reviewed-by: Andras Becsi --- src/core/web_contents_delegate_qt.cpp | 6 ++++++ src/core/web_contents_delegate_qt.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 5a96d9be4..27d1c3e9a 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -109,6 +109,12 @@ void WebContentsDelegateQt::DidFinishLoad(int64 frame_id, const GURL &validated_ m_viewClient->loadFinished(true); } +void WebContentsDelegateQt::DidFailProvisionalLoad(int64 frame_id, bool is_main_frame, const GURL& validated_url, int error_code, const string16& error_description, content::RenderViewHost* render_view_host) +{ + if (is_main_frame) + DidFailLoad(frame_id, validated_url, is_main_frame, error_code, error_description, render_view_host); +} + void WebContentsDelegateQt::DidUpdateFaviconURL(int32 page_id, const std::vector& candidates) { Q_UNUSED(page_id) diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 9e27c043f..b0cfd8952 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -71,6 +71,7 @@ public: virtual void DidFailLoad(int64 frame_id, const GURL &validated_url, bool is_main_frame, int error_code, const string16 &error_description, content::RenderViewHost *render_view_host) Q_DECL_OVERRIDE; virtual void DidFinishLoad(int64 frame_id, const GURL &validated_url, bool is_main_frame, content::RenderViewHost *render_view_host) Q_DECL_OVERRIDE; virtual void DidUpdateFaviconURL(int32 page_id, const std::vector& candidates) Q_DECL_OVERRIDE; + virtual void DidFailProvisionalLoad(int64 frame_id, bool is_main_frame, const GURL& validated_url, int error_code, const string16& error_description, content::RenderViewHost* render_view_host) Q_DECL_OVERRIDE; virtual content::JavaScriptDialogManager *GetJavaScriptDialogManager() Q_DECL_OVERRIDE; private: -- cgit v1.2.3