[epiphany] ephy-web-view: Use webkit_web_view_load_alternate_html() for error pages in WebKit2



commit cb6d7aa9349f7b7fbe6456cc49009152a812530b
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Tue Aug 21 17:21:57 2012 +0200

    ephy-web-view: Use webkit_web_view_load_alternate_html() for error pages in WebKit2
    
    webkit_web_view_replace_content() has been removed

 embed/ephy-web-view.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 4862d83..5dede1a 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2154,7 +2154,8 @@ load_changed_cb (WebKitWebView *web_view,
     restore_zoom_level (view, uri);
 
     /* History. */
-    if (!ephy_web_view_is_loading_homepage (view)) {
+    if (!ephy_web_view_is_loading_homepage (view) &&
+        !ephy_web_view_is_history_frozen (view)) {
       char *history_uri = NULL;
 
       /* TODO: move the normalization down to the history service? */
@@ -2169,6 +2170,9 @@ load_changed_cb (WebKitWebView *web_view,
 
       g_free (history_uri);
     }
+
+    ephy_web_view_thaw_history (view);
+
     break;
   }
   case WEBKIT_LOAD_FINISHED: {
@@ -2521,17 +2525,11 @@ ephy_web_view_load_error_page (EphyWebView *view,
   g_free (button_label);
   g_free (image_data);
 
+  /* Make our history backend ignore the next page load, since it will be an error page. */
+  ephy_web_view_freeze_history (view);
 #ifdef HAVE_WEBKIT2
-  webkit_web_view_replace_content (WEBKIT_WEB_VIEW (view), html->str, uri, 0);
+  webkit_web_view_load_alternate_html (WEBKIT_WEB_VIEW (view), html->str, uri, 0);
 #else
-  /* Make our history backend ignore the next page load, since it will be an error page.
-   *
-   * FIXME: at this point error pages in WebKit2 do not trigger load
-   * events, so this is only needed for WebKit1. This might (probably
-   * will?) change soon, so keep an eye on WebKit2 and change this
-   * accordingly.
-   */
-  ephy_web_view_freeze_history (view);
   webkit_web_frame_load_alternate_string (webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view)),
                                           html->str, uri, uri);
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]