aboutsummaryrefslogtreecommitdiffstats
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
parentc58efa251b4a978f9621b8ebcd4de4e4f4f695d2 (diff)
downloadgsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.tar
gsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.tar.gz
gsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.tar.bz2
gsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.tar.lz
gsoc2013-epiphany-603a9503df75635a63a5dc42454a9a61bcc518c2.tar.xz
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.
-rw-r--r--embed/ephy-web-view.c32
-rw-r--r--embed/ephy-web-view.h16
2 files changed, 37 insertions, 11 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;
+}
diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h
index 789d6cfa5..46336e75b 100644
--- a/embed/ephy-web-view.h
+++ b/embed/ephy-web-view.h
@@ -124,6 +124,8 @@ struct _EphyWebViewClass
void (* new_document_now) (EphyWebView *view,
const char *uri);
+
+ void (* loading_homepage) (EphyWebView *view);
};
GType ephy_web_view_get_type (void);
@@ -190,11 +192,15 @@ void ephy_web_view_save (EphyWebView
const char *uri);
void ephy_web_view_load_homepage (EphyWebView *view);
-char *
-ephy_web_view_create_web_application (EphyWebView *view, const char *title, GdkPixbuf *icon);
-
-GdkPixbuf *
-ephy_web_view_get_snapshot (EphyWebView *view, int x, int y, int width, int height);
+char * ephy_web_view_create_web_application (EphyWebView *view,
+ const char *title,
+ GdkPixbuf *icon);
+GdkPixbuf * ephy_web_view_get_snapshot (EphyWebView *view,
+ int x,
+ int y,
+ int width,
+ int height);
+gboolean ephy_web_view_is_loading_homepage (EphyWebView *view);
G_END_DECLS