aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-web-view.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-08 02:55:34 +0800
committerXan Lopez <xan@igalia.com>2012-03-08 02:57:21 +0800
commit603a9503df75635a63a5dc42454a9a61bcc518c2 (patch)
tree37f7445b1c8429a26c8fde704b5568d760975632 /embed/ephy-web-view.c
parentc58efa251b4a978f9621b8ebcd4de4e4f4f695d2 (diff)
downloadgsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.tar.gz
gsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.tar.zst
gsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.zip
ephy-web-view: remember when we are loading the homepage
And add a getter for the information.
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r--embed/ephy-web-view.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 6448b0e2d..404b6167a 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -79,6 +79,7 @@ struct _EphyWebViewPrivate {
/* Flags */
guint is_blank : 1;
guint visibility : 1;
+ guint loading_homepage : 1;
char *address;
char *typed_address;
@@ -1137,6 +1138,12 @@ ephy_web_view_constructed (GObject *object)
}
static void
+impl_loading_homepage (EphyWebView *view)
+{
+ view->priv->loading_homepage = TRUE;
+}
+
+static void
ephy_web_view_class_init (EphyWebViewClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -1151,6 +1158,8 @@ ephy_web_view_class_init (EphyWebViewClass *klass)
widget_class->button_press_event = ephy_web_view_button_press_event;
widget_class->key_press_event = ephy_web_view_key_press_event;
+ klass->loading_homepage = impl_loading_homepage;
+
/**
* EphyWebView:address:
*
@@ -1502,12 +1511,13 @@ ephy_web_view_class_init (EphyWebViewClass *klass)
* load the homepage set by the user.
**/
g_signal_new ("loading-homepage",
- EPHY_TYPE_WEB_VIEW,
- G_SIGNAL_RUN_FIRST,
- 0, NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
+ EPHY_TYPE_WEB_VIEW,
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EphyWebViewClass, loading_homepage),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
g_type_class_add_private (gobject_class, sizeof (EphyWebViewPrivate));
}
@@ -1895,6 +1905,8 @@ load_status_cb (WebKitWebView *web_view,
case WEBKIT_LOAD_FINISHED: {
SoupURI *uri;
+ priv->loading_homepage = FALSE;
+
g_free (priv->status_message);
priv->status_message = NULL;
g_object_notify (object, "status-message");
@@ -3770,3 +3782,11 @@ ephy_web_view_get_snapshot (EphyWebView *view, int x, int y, int width, int heig
return snapshot;
}
+
+gboolean
+ephy_web_view_is_loading_homepage (EphyWebView *view)
+{
+ g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), FALSE);
+
+ return view->priv->loading_homepage;
+}