aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ephy-tab.c48
-rw-r--r--src/ephy-tab.h2
-rw-r--r--src/ephy-window.c31
-rw-r--r--src/epiphany.defs6
4 files changed, 17 insertions, 70 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 01eb2552a..d22a6abd5 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -97,7 +97,6 @@ struct _EphyTabPrivate
GSList *hidden_popups;
GSList *shown_popups;
EphyTabNavigationFlags nav_flags;
- EphyEmbedDocumentType document_type;
guint idle_resize_handler;
gint8 load_percent;
@@ -123,7 +122,6 @@ enum
{
PROP_0,
PROP_ADDRESS,
- PROP_DOCUMENT_TYPE,
PROP_ICON,
PROP_ICON_ADDRESS,
PROP_LOAD_PROGRESS,
@@ -237,7 +235,6 @@ ephy_tab_set_property (GObject *object,
ephy_tab_set_icon_address (tab, g_value_get_string (value));
break;
case PROP_ADDRESS:
- case PROP_DOCUMENT_TYPE:
case PROP_ICON:
case PROP_LOAD_PROGRESS:
case PROP_LOAD_STATUS:
@@ -265,9 +262,6 @@ ephy_tab_get_property (GObject *object,
case PROP_ADDRESS:
g_value_set_string (value, priv->address);
break;
- case PROP_DOCUMENT_TYPE:
- g_value_set_enum (value, priv->document_type);
- break;
case PROP_ICON:
g_value_set_object (value, priv->icon);
break;
@@ -403,15 +397,6 @@ ephy_tab_class_init (EphyTabClass *class)
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (object_class,
- PROP_DOCUMENT_TYPE,
- g_param_spec_enum ("document-type",
- "Document Type",
- "The tab's documen type",
- EPHY_TYPE_EMBED_DOCUMENT_TYPE,
- EPHY_EMBED_DOCUMENT_HTML,
- G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
-
- g_object_class_install_property (object_class,
PROP_ICON,
g_param_spec_object ("icon",
"Icon",
@@ -990,22 +975,6 @@ ephy_tab_set_load_status (EphyTab *tab, gboolean status)
}
/**
- * ephy_tab_get_document_type:
- * @tab: an #EphyTab
- *
- * Returns the type of the document loaded in @tab.
- *
- * Return value: the #EphyEmbedDocumentType
- **/
-EphyEmbedDocumentType
-ephy_tab_get_document_type (EphyTab *tab)
-{
- g_return_val_if_fail (EPHY_IS_TAB (tab), EPHY_EMBED_DOCUMENT_OTHER);
-
- return tab->priv->document_type;
-}
-
-/**
* ephy_tab_get_load_status:
* @tab: an #EphyTab
*
@@ -1596,19 +1565,6 @@ ephy_tab_content_change_cb (EphyEmbed *embed, const char *address, EphyTab *tab)
}
static void
-ephy_tab_document_type_cb (EphyEmbed *embed,
- EphyEmbedDocumentType type,
- EphyTab *tab)
-{
- if (tab->priv->document_type != type)
- {
- tab->priv->document_type = type;
-
- g_object_notify (G_OBJECT (tab), "document-type");
- }
-}
-
-static void
ephy_tab_zoom_changed_cb (EphyEmbed *embed, float zoom, EphyTab *tab)
{
char *address;
@@ -2085,7 +2041,6 @@ ephy_tab_init (EphyTab *tab)
tab->priv->height = -1;
tab->priv->load_percent = 0;
tab->priv->is_loading = FALSE;
- tab->priv->document_type = EPHY_EMBED_DOCUMENT_HTML;
tab->priv->zoom = 1.0;
priv->title = NULL;
priv->is_blank = TRUE;
@@ -2107,9 +2062,6 @@ ephy_tab_init (EphyTab *tab)
g_signal_connect_object (embed, "link_message",
G_CALLBACK (ephy_tab_link_message_cb),
tab, 0);
- g_signal_connect_object (embed, "ge_document_type",
- G_CALLBACK (ephy_tab_document_type_cb),
- tab, 0);
g_signal_connect_object (embed, "open_uri",
G_CALLBACK (ephy_tab_open_uri_cb),
tab, 0);
diff --git a/src/ephy-tab.h b/src/ephy-tab.h
index 425afc796..cb40338a7 100644
--- a/src/ephy-tab.h
+++ b/src/ephy-tab.h
@@ -75,8 +75,6 @@ EphyEmbed *ephy_tab_get_embed (EphyTab *tab);
EphyTab *ephy_tab_for_embed (EphyEmbed *embed);
-EphyEmbedDocumentType ephy_tab_get_document_type (EphyTab *tab);
-
GdkPixbuf *ephy_tab_get_icon (EphyTab *tab);
const char *ephy_tab_get_icon_address (EphyTab *tab);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3ae490fc3..47c02f5be 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1388,7 +1388,7 @@ sync_tab_address (EphyTab *tab,
}
static void
-sync_tab_document_type (EphyTab *tab,
+sync_tab_document_type (EphyEmbed *embed,
GParamSpec *pspec,
EphyWindow *window)
{
@@ -1401,9 +1401,10 @@ sync_tab_document_type (EphyTab *tab,
if (priv->closing) return;
/* update zoom actions */
- sync_tab_zoom (tab, NULL, window);
+ /* FIXME: need to move zoom to embed to uncomment this
+ sync_tab_zoom (tab, NULL, window);*/
- type = ephy_tab_get_document_type (tab);
+ type = ephy_embed_get_document_type (embed);
can_find = (type != EPHY_EMBED_DOCUMENT_IMAGE);
is_image = type == EPHY_EMBED_DOCUMENT_IMAGE;
disable = (type != EPHY_EMBED_DOCUMENT_HTML);
@@ -1729,7 +1730,7 @@ sync_tab_zoom (EphyTab *tab, GParamSpec *pspec, EphyWindow *window)
if (window->priv->closing) return;
zoom = ephy_tab_get_zoom (tab);
- type = ephy_tab_get_document_type (tab);
+ type = ephy_embed_get_document_type (ephy_tab_get_embed (tab));
can_zoom = (type != EPHY_EMBED_DOCUMENT_IMAGE);
if (zoom >= ZOOM_MAXIMAL)
@@ -2149,9 +2150,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
G_CALLBACK (sync_tab_address),
window);
g_signal_handlers_disconnect_by_func (old_tab,
- G_CALLBACK (sync_tab_document_type),
- window);
- g_signal_handlers_disconnect_by_func (old_tab,
G_CALLBACK (sync_tab_icon),
window);
g_signal_handlers_disconnect_by_func (old_tab,
@@ -2167,9 +2165,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
G_CALLBACK (sync_tab_navigation),
window);
g_signal_handlers_disconnect_by_func (old_tab,
- G_CALLBACK (sync_tab_security),
- window);
- g_signal_handlers_disconnect_by_func (old_tab,
G_CALLBACK (sync_tab_popup_windows),
window);
g_signal_handlers_disconnect_by_func (old_tab,
@@ -2183,6 +2178,14 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
window);
embed = ephy_tab_get_embed (old_tab);
+
+ g_signal_handlers_disconnect_by_func (embed,
+ G_CALLBACK (sync_tab_security),
+ window);
+ g_signal_handlers_disconnect_by_func (embed,
+ G_CALLBACK (sync_tab_document_type),
+ window);
+
g_signal_handlers_disconnect_by_func
(embed, G_CALLBACK (tab_context_menu_cb), window);
g_signal_handlers_disconnect_by_func
@@ -2197,9 +2200,9 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
embed = ephy_tab_get_embed (new_tab);
sync_tab_security (embed, NULL, window);
+ sync_tab_document_type (embed, NULL, window);
sync_tab_address (new_tab, NULL, window);
- sync_tab_document_type (new_tab, NULL, window);
sync_tab_icon (new_tab, NULL, window);
sync_tab_load_progress (new_tab, NULL, window);
sync_tab_load_status (new_tab, NULL, window);
@@ -2213,9 +2216,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
g_signal_connect_object (new_tab, "notify::address",
G_CALLBACK (sync_tab_address),
window, 0);
- g_signal_connect_object (new_tab, "notify::document-type",
- G_CALLBACK (sync_tab_document_type),
- window, 0);
g_signal_connect_object (new_tab, "notify::icon",
G_CALLBACK (sync_tab_icon),
window, 0);
@@ -2247,6 +2247,9 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
g_signal_connect_object (embed, "notify::security-level",
G_CALLBACK (sync_tab_security),
window, 0);
+ g_signal_connect_object (embed, "notify::document-type",
+ G_CALLBACK (sync_tab_document_type),
+ window, 0);
g_signal_connect_object (embed, "ge-context-menu",
G_CALLBACK (tab_context_menu_cb),
window, G_CONNECT_AFTER);
diff --git a/src/epiphany.defs b/src/epiphany.defs
index c7965760c..37ac91b24 100644
--- a/src/epiphany.defs
+++ b/src/epiphany.defs
@@ -3323,12 +3323,6 @@
)
)
-(define-method get_document_type
- (of-object "EphyTab")
- (c-name "ephy_tab_get_document_type")
- (return-type "EphyEmbedDocumentType")
-)
-
(define-method get_icon
(of-object "EphyTab")
(c-name "ephy_tab_get_icon")