epiphany r8328 - in trunk/embed: . webkit
- From: xan svn gnome org
- To: svn-commits-list gnome org
- Subject: epiphany r8328 - in trunk/embed: . webkit
- Date: Mon, 30 Jun 2008 21:27:23 +0000 (UTC)
Author: xan
Date: Mon Jun 30 21:27:22 2008
New Revision: 8328
URL: http://svn.gnome.org/viewvc/epiphany?rev=8328&view=rev
Log:
embed: restore restore_zoom_level.
Modified:
trunk/embed/ephy-base-embed.c
trunk/embed/webkit/webkit-embed.c
Modified: trunk/embed/ephy-base-embed.c
==============================================================================
--- trunk/embed/ephy-base-embed.c (original)
+++ trunk/embed/ephy-base-embed.c Mon Jun 30 21:27:22 2008
@@ -59,7 +59,6 @@
/* Flags */
guint is_blank : 1;
guint is_loading : 1;
- guint is_setting_zoom : 1;
guint visibility : 1;
gint8 load_percent;
@@ -1492,40 +1491,6 @@
}
}
-#if 0
-void
-ephy_base_embed_restore_zoom_level (EphyBaseEmbed *membed,
- const char *address)
-{
- EphyBaseEmbedPrivate *priv = membed->priv;
-
- /* restore zoom level */
- if (ephy_embed_utils_address_has_web_scheme (address)) {
- EphyHistory *history;
- EphyNode *host;
- GValue value = { 0, };
- float zoom = 1.0, current_zoom;
-
- history = EPHY_HISTORY
- (ephy_embed_shell_get_global_history (embed_shell));
- host = ephy_history_get_host (history, address);
-
- if (host != NULL && ephy_node_get_property
- (host, EPHY_NODE_HOST_PROP_ZOOM, &value)) {
- zoom = g_value_get_float (&value);
- g_value_unset (&value);
- }
-
- current_zoom = ephy_embed_get_zoom (EPHY_EMBED (membed));
- if (zoom != current_zoom) {
- priv->is_setting_zoom = TRUE;
- ephy_embed_set_zoom (EPHY_EMBED (membed), zoom);
- priv->is_setting_zoom = FALSE;
- }
- }
-}
-#endif
-
void
ephy_base_embed_set_visibility (EphyBaseEmbed *embed,
gboolean visibility)
Modified: trunk/embed/webkit/webkit-embed.c
==============================================================================
--- trunk/embed/webkit/webkit-embed.c (original)
+++ trunk/embed/webkit/webkit-embed.c Mon Jun 30 21:27:22 2008
@@ -59,6 +59,7 @@
WebKitEmbedLoadState load_state;
char *loading_uri;
EphyHistory *history;
+ guint is_setting_zoom : 1;
};
static void
@@ -156,6 +157,43 @@
}
static void
+restore_zoom_level (WebKitEmbed *embed,
+ const char *address)
+{
+ WebKitEmbedPrivate *priv = embed->priv;
+
+ /* restore zoom level */
+ if (ephy_embed_utils_address_has_web_scheme (address)) {
+ EphyHistory *history;
+ EphyNode *host;
+ WebKitWebView *web_view;
+ GValue value = { 0, };
+ float zoom = 1.0, current_zoom;
+
+ history = EPHY_HISTORY
+ (ephy_embed_shell_get_global_history (embed_shell));
+ host = ephy_history_get_host (history, address);
+
+ if (host != NULL && ephy_node_get_property
+ (host, EPHY_NODE_HOST_PROP_ZOOM, &value)) {
+ zoom = g_value_get_float (&value);
+ g_value_unset (&value);
+ }
+
+ web_view = priv->web_view;
+
+ g_object_get (G_OBJECT (web_view), "zoom-level", ¤t_zoom,
+ NULL);
+
+ if (zoom != current_zoom) {
+ priv->is_setting_zoom = TRUE;
+ g_object_set (G_OBJECT (web_view), "zoom-level", zoom, NULL);
+ priv->is_setting_zoom = FALSE;
+ }
+ }
+}
+
+static void
webkit_embed_load_committed_cb (WebKitWebView *web_view,
WebKitWebFrame *web_frame,
EphyEmbed *embed)
@@ -164,6 +202,7 @@
ephy_base_embed_location_changed (EPHY_BASE_EMBED (embed),
uri);
+ restore_zoom_level (WEBKIT_EMBED (embed), uri);
ephy_history_add_page (WEBKIT_EMBED (embed)->priv->history,
uri,
FALSE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]