aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2009-06-02 23:56:28 +0800
committerXan Lopez <xan@gnome.org>2009-06-03 00:08:50 +0800
commita62be2bb0ad051a60b99b02e39c58f96dd5b3b9e (patch)
treec551691573045b474c0cb894cc98ba4dbd5fc6bb /embed
parent9f4b66ef75418ea4f51179432f4d5aeca4e586ed (diff)
downloadgsoc2013-epiphany-a62be2bb0ad051a60b99b02e39c58f96dd5b3b9e.tar
gsoc2013-epiphany-a62be2bb0ad051a60b99b02e39c58f96dd5b3b9e.tar.gz
gsoc2013-epiphany-a62be2bb0ad051a60b99b02e39c58f96dd5b3b9e.tar.bz2
gsoc2013-epiphany-a62be2bb0ad051a60b99b02e39c58f96dd5b3b9e.tar.lz
gsoc2013-epiphany-a62be2bb0ad051a60b99b02e39c58f96dd5b3b9e.tar.xz
gsoc2013-epiphany-a62be2bb0ad051a60b99b02e39c58f96dd5b3b9e.tar.zst
gsoc2013-epiphany-a62be2bb0ad051a60b99b02e39c58f96dd5b3b9e.zip
Move load_url method to EphyWebView.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c15
-rw-r--r--embed/ephy-embed.h5
-rw-r--r--embed/ephy-web-view.c17
-rw-r--r--embed/ephy-web-view.h3
-rw-r--r--embed/webkit/webkit-embed.c29
5 files changed, 24 insertions, 45 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 04b94bba1..29ecfed9d 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -350,21 +350,6 @@ ephy_embed_base_init (gpointer g_class)
}
/**
- * ephy_embed_load_url:
- * @embed: an #EphyEmbed
- * @url: a URL
- *
- * Loads a new web page in @embed.
- **/
-void
-ephy_embed_load_url (EphyEmbed *embed,
- const char *url)
-{
- EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
- iface->load_url (embed, url);
-}
-
-/**
* ephy_embed_can_go_up:
* @embed: an #EphyEmbed
*
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index a974ae790..2f48763c4 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -154,8 +154,6 @@ struct _EphyEmbedIface
const char *uri);
/* Methods */
- void (* load_url) (EphyEmbed *embed,
- const char *url);
gboolean (* can_go_up) (EphyEmbed *embed);
GSList * (* get_go_up_list) (EphyEmbed *embed);
void (* go_up) (EphyEmbed *embed);
@@ -203,9 +201,6 @@ GType ephy_embed_document_type_get_type (void);
GType ephy_embed_get_type (void);
/* Base */
-void ephy_embed_load_url (EphyEmbed *embed,
- const char *url);
-
const char *ephy_embed_get_title (EphyEmbed *embed);
char *ephy_embed_get_location (EphyEmbed *embed,
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 7606e6d01..10e6d3475 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -77,6 +77,23 @@ ephy_web_view_load_request (EphyWebView *web_view,
}
/**
+ * ephy_web_view_load_url:
+ * @embed: an #EphyWebView
+ * @url: a URL
+ *
+ * Loads @url in @embed.
+ **/
+void
+ephy_web_view_load_url (EphyWebView *view,
+ const char *url)
+{
+ g_return_if_fail (EPHY_IS_WEB_VIEW (view));
+ g_return_if_fail (url);
+
+ webkit_web_view_open (WEBKIT_WEB_VIEW (view), url);
+}
+
+/**
* ephy_web_view_copy_back_history:
* @source: the #EphyWebView from which to get the back history
* @dest: the #EphyWebView to copy the history to
diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h
index 870b54c43..898133040 100644
--- a/embed/ephy-web-view.h
+++ b/embed/ephy-web-view.h
@@ -63,6 +63,9 @@ GtkWidget *ephy_web_view_new (void);
void ephy_web_view_load_request (EphyWebView *web_view,
WebKitNetworkRequest *request);
+void ephy_web_view_load_url (EphyWebView *web_view,
+ const char *url);
+
void ephy_web_view_copy_back_history (EphyWebView *source,
EphyWebView *dest);
diff --git a/embed/webkit/webkit-embed.c b/embed/webkit/webkit-embed.c
index 8528759a9..c7e5f9f54 100644
--- a/embed/webkit/webkit-embed.c
+++ b/embed/webkit/webkit-embed.c
@@ -72,7 +72,6 @@ struct WebKitEmbedPrivate
WebKitWebView *web_view;
GtkScrolledWindow *scrolled_window;
WebKitEmbedLoadState load_state;
- char *loading_uri;
EphyHistory *history;
GtkWidget *inspector_window;
guint is_setting_zoom : 1;
@@ -150,6 +149,7 @@ static void
update_load_state (WebKitEmbed *embed, WebKitWebView *web_view)
{
EphyEmbedNetState estate = EPHY_EMBED_STATE_UNKNOWN;
+ const char *loading_uri = ephy_embed_get_typed_address (embed);
if (embed->priv->load_state == WEBKIT_EMBED_LOAD_STARTED)
{
@@ -159,7 +159,7 @@ update_load_state (WebKitEmbed *embed, WebKitWebView *web_view)
EPHY_EMBED_STATE_IS_REQUEST |
EPHY_EMBED_STATE_IS_NETWORK);
- g_signal_emit_by_name (embed, "new-document-now", embed->priv->loading_uri);
+ g_signal_emit_by_name (embed, "new-document-now", loading_uri);
}
if (embed->priv->load_state == WEBKIT_EMBED_LOAD_LOADING)
@@ -175,7 +175,7 @@ update_load_state (WebKitEmbed *embed, WebKitWebView *web_view)
EPHY_EMBED_STATE_IS_NETWORK);
ephy_base_embed_update_from_net_state (EPHY_BASE_EMBED (embed),
- embed->priv->loading_uri,
+ loading_uri,
(EphyEmbedNetState)estate);
}
@@ -326,23 +326,9 @@ zoom_changed_cb (WebKitWebView *web_view,
}
static void
-webkit_embed_finalize (GObject *object)
-{
- WebKitEmbed *wembed = WEBKIT_EMBED (object);
-
- g_free (wembed->priv->loading_uri);
-
- G_OBJECT_CLASS (webkit_embed_parent_class)->finalize (object);
-}
-
-static void
webkit_embed_class_init (WebKitEmbedClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = webkit_embed_finalize;
-
- g_type_class_add_private (object_class, sizeof(WebKitEmbedPrivate));
+ g_type_class_add_private (G_OBJECT_CLASS (klass), sizeof(WebKitEmbedPrivate));
}
static WebKitWebView *
@@ -784,12 +770,6 @@ static void
impl_load_url (EphyEmbed *embed,
const char *url)
{
- WebKitEmbed *wembed = WEBKIT_EMBED (embed);
-
- g_free (wembed->priv->loading_uri);
- wembed->priv->loading_uri = g_strdup (url);
-
- webkit_web_view_open (wembed->priv->web_view, url);
}
static gboolean
@@ -872,7 +852,6 @@ impl_has_modified_forms (EphyEmbed *embed)
static void
ephy_embed_iface_init (EphyEmbedIface *iface)
{
- iface->load_url = impl_load_url;
iface->can_go_up = impl_can_go_up;
iface->get_go_up_list = impl_get_go_up_list;
iface->go_up = impl_go_up;