[epiphany] Fix loading HTTP auth protected pages from the overview



commit 10163f64235b535f49647a6ad0cfa5e3b0f179a9
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed Feb 20 15:04:44 2013 +0100

    Fix loading HTTP auth protected pages from the overview
    
    The switch between overview and normal web page happens when the page
    load is committed, in case of HTTP auth protected pages we never switch
    to web page mode because authentication happens before the load is
    committed. In WebKit2 the auth dialog is attached to the web view, so we
    need to show the web view before the load is committed to show the auth
    dialog.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694268

 embed/ephy-embed.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index a91509c..a465a14 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -298,12 +298,19 @@ load_changed_cb (WebKitWebView *web_view,
                  WebKitLoadEvent load_event,
                  EphyEmbed *embed)
 {
-  const char *address;
+  switch (load_event) {
+  case WEBKIT_LOAD_STARTED: {
+    const char *uri;
 
-  if (load_event == WEBKIT_LOAD_COMMITTED) {
+    uri = webkit_web_view_get_uri (web_view);
+    ephy_embed_set_overview_mode (embed, strcmp (uri, "ephy-about:overview") == 0);
+    break;
+  }
+  case WEBKIT_LOAD_COMMITTED:
     ephy_embed_destroy_top_widgets (embed);
-    address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view));
-    ephy_embed_set_overview_mode (embed, strcmp (address, "ephy-about:overview") == 0);
+    break;
+  default:
+    break;
   }
 }
 #else


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