[epiphany] web-extension: Make the overview work again
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] web-extension: Make the overview work again
- Date: Thu, 27 Nov 2014 09:15:49 +0000 (UTC)
commit 9ba4f00ba1caa5e89538c2201e0cf642cb5213cc
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Thu Nov 27 10:12:19 2014 +0100
web-extension: Make the overview work again
I removed the code that creates the EphyWebOverview by mistake in a
previous patch.
embed/web-extension/ephy-web-extension.c | 16 ++++++++++++
embed/web-extension/ephy-web-overview.c | 39 ------------------------------
2 files changed, 16 insertions(+), 39 deletions(-)
---
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index d932a45..86e600a 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -982,6 +982,19 @@ web_page_document_loaded (WebKitWebPage *web_page,
}
static void
+web_page_uri_changed (WebKitWebPage *web_page,
+ GParamSpec *param_spec,
+ EphyWebExtension *extension)
+{
+ EphyWebOverview *overview = NULL;
+
+ if (g_strcmp0 (webkit_web_page_get_uri (web_page), "ephy-about:overview") == 0)
+ overview = ephy_web_overview_new (web_page, extension->priv->overview_model);
+
+ g_object_set_data_full (G_OBJECT (web_page), "ephy-web-overview", overview, g_object_unref);
+}
+
+static void
ephy_web_extension_emit_page_created (EphyWebExtension *extension,
guint64 page_id)
{
@@ -1046,6 +1059,9 @@ ephy_web_extension_page_created_cb (EphyWebExtension *extension,
g_signal_connect (web_page, "document-loaded",
G_CALLBACK (web_page_document_loaded),
extension);
+ g_signal_connect (web_page, "notify::uri",
+ G_CALLBACK (web_page_uri_changed),
+ extension);
}
static WebKitWebPage *
diff --git a/embed/web-extension/ephy-web-overview.c b/embed/web-extension/ephy-web-overview.c
index fe0c6b8..2bfa124 100644
--- a/embed/web-extension/ephy-web-overview.c
+++ b/embed/web-extension/ephy-web-overview.c
@@ -105,15 +105,6 @@ overview_item_free (OverviewItem *item)
}
static void
-ephy_web_overview_web_page_uri_changed (WebKitWebPage *web_page,
- GParamSpec *spec,
- EphyWebOverview *overview)
-{
- if (g_strcmp0 (webkit_web_page_get_uri (web_page), "ephy-about:overview") != 0)
- g_object_unref (overview);
-}
-
-static void
update_thumbnail_element_style (WebKitDOMElement *thumbnail,
const char *path)
{
@@ -374,41 +365,12 @@ ephy_web_overview_dispose (GObject *object)
}
static void
-ephy_web_overview_web_view_destroyed (EphyWebOverview *overview,
- GObject *destroyed_web_view)
-{
- overview->priv->web_page = NULL;
- g_object_unref (overview);
-}
-
-static void
-ephy_web_overview_finalize (GObject *object)
-{
- EphyWebOverview *overview = EPHY_WEB_OVERVIEW (object);
-
- if (overview->priv->web_page) {
- g_object_weak_unref (G_OBJECT (overview->priv->web_page),
- (GWeakNotify)ephy_web_overview_web_view_destroyed,
- overview);
- }
-
- G_OBJECT_CLASS (ephy_web_overview_parent_class)->finalize (object);
-}
-
-static void
ephy_web_overview_constructed (GObject *object)
{
EphyWebOverview *overview = EPHY_WEB_OVERVIEW (object);
G_OBJECT_CLASS (ephy_web_overview_parent_class)->constructed (object);
- g_object_weak_ref (G_OBJECT (overview->priv->web_page),
- (GWeakNotify)ephy_web_overview_web_view_destroyed,
- overview);
-
- g_signal_connect_object (overview->priv->web_page, "notify::uri",
- G_CALLBACK (ephy_web_overview_web_page_uri_changed),
- overview, 0);
g_signal_connect_object (overview->priv->web_page, "document-loaded",
G_CALLBACK (ephy_web_overview_document_loaded),
overview, 0);
@@ -430,7 +392,6 @@ ephy_web_overview_class_init (EphyWebOverviewClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = ephy_web_overview_dispose;
- object_class->finalize = ephy_web_overview_finalize;
object_class->constructed = ephy_web_overview_constructed;
object_class->set_property = ephy_web_overview_set_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]