diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2013-02-20 02:28:05 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2013-03-05 16:58:10 +0800 |
commit | 0b67bd0b7c0d391441b60da38a1720f4d840d920 (patch) | |
tree | ee8e49717c92d4d3e549f07251bb977e8cc0a2f8 | |
parent | 4e23859050fd1410820312c16a21b3716d9f08e9 (diff) | |
download | gsoc2013-epiphany-0b67bd0b7c0d391441b60da38a1720f4d840d920.tar gsoc2013-epiphany-0b67bd0b7c0d391441b60da38a1720f4d840d920.tar.gz gsoc2013-epiphany-0b67bd0b7c0d391441b60da38a1720f4d840d920.tar.bz2 gsoc2013-epiphany-0b67bd0b7c0d391441b60da38a1720f4d840d920.tar.lz gsoc2013-epiphany-0b67bd0b7c0d391441b60da38a1720f4d840d920.tar.xz gsoc2013-epiphany-0b67bd0b7c0d391441b60da38a1720f4d840d920.tar.zst gsoc2013-epiphany-0b67bd0b7c0d391441b60da38a1720f4d840d920.zip |
incognito: show about:incognito instead of the overview
The overview shouldn't be shown in an incognito window as it reveals
information about the browsing activity of the user. Also, a welcome
page indicating the scope of the incognito window is better.
https://bugzilla.gnome.org/show_bug.cgi?id=694200
-rw-r--r-- | embed/ephy-embed.c | 21 | ||||
-rw-r--r-- | embed/ephy-web-view.c | 6 | ||||
-rw-r--r-- | src/ephy-window.c | 24 |
3 files changed, 33 insertions, 18 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 608a9a047..0fdf921fb 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -961,15 +961,18 @@ ephy_embed_constructed (GObject *object) gtk_container_add (GTK_CONTAINER (overlay), scrolled_window); #endif - /* The overview */ - priv->overview = ephy_overview_new (); - gtk_widget_set_halign (priv->overview, GTK_ALIGN_FILL); - gtk_widget_set_valign (priv->overview, GTK_ALIGN_FILL); - gtk_overlay_add_overlay (GTK_OVERLAY (overlay), priv->overview); - - g_object_bind_property (embed, "overview-mode", - priv->overview, "visible", - G_BINDING_SYNC_CREATE); + /* The overview. In incognito mode we don't use it. */ + if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != + EPHY_EMBED_SHELL_MODE_INCOGNITO) { + priv->overview = ephy_overview_new (); + gtk_widget_set_halign (priv->overview, GTK_ALIGN_FILL); + gtk_widget_set_valign (priv->overview, GTK_ALIGN_FILL); + gtk_overlay_add_overlay (GTK_OVERLAY (overlay), priv->overview); + + g_object_bind_property (embed, "overview-mode", + priv->overview, "visible", + G_BINDING_SYNC_CREATE); + } /* Floating message popup for fullscreen mode. */ priv->fullscreen_message_label = gtk_label_new (NULL); diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index a69b3f9ee..b886da9d4 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -3962,7 +3962,11 @@ ephy_web_view_load_homepage (EphyWebView *view) ephy_web_view_set_visit_type (view, EPHY_PAGE_VISIT_HOMEPAGE); - ephy_web_view_load_url (view, "about:overview"); + if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) + == EPHY_EMBED_SHELL_MODE_INCOGNITO) + ephy_web_view_load_url (view, "about:incognito"); + else + ephy_web_view_load_url (view, "about:overview"); } /** diff --git a/src/ephy-window.c b/src/ephy-window.c index a59c310d0..6b760f19f 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2686,6 +2686,7 @@ ephy_window_connect_active_embed (EphyWindow *window) WebKitWebView *web_view; EphyWebView *view; EphyOverview *overview; + EphyEmbedShellMode shell_mode; g_return_if_fail (window->priv->active_embed != NULL); @@ -2787,10 +2788,13 @@ ephy_window_connect_active_embed (EphyWindow *window) G_CALLBACK (sync_embed_is_overview), window, 0); - overview = ephy_embed_get_overview (embed); - g_signal_connect_object (overview, "open-link", - G_CALLBACK (overview_open_link_cb), - window, 0); + shell_mode = ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (ephy_embed_shell_get_default ())); + if (shell_mode != EPHY_EMBED_SHELL_MODE_INCOGNITO) { + overview = ephy_embed_get_overview (embed); + g_signal_connect_object (overview, "open-link", + G_CALLBACK (overview_open_link_cb), + window, 0); + } g_object_notify (G_OBJECT (window), "active-child"); } @@ -2803,6 +2807,7 @@ ephy_window_disconnect_active_embed (EphyWindow *window) EphyWebView *view; EphyOverview *overview; guint sid; + EphyEmbedShellMode shell_mode; g_return_if_fail (window->priv->active_embed != NULL); @@ -2876,10 +2881,13 @@ ephy_window_disconnect_active_embed (EphyWindow *window) G_CALLBACK (sync_embed_is_overview), window); - overview = ephy_embed_get_overview (embed); - g_signal_handlers_disconnect_by_func (overview, - G_CALLBACK (overview_open_link_cb), - window); + shell_mode = ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (ephy_embed_shell_get_default ())); + if (shell_mode != EPHY_EMBED_SHELL_MODE_INCOGNITO) { + overview = ephy_embed_get_overview (embed); + g_signal_handlers_disconnect_by_func (overview, + G_CALLBACK (overview_open_link_cb), + window); + } g_signal_handlers_disconnect_by_func (view, G_CALLBACK (ephy_window_dom_mouse_click_cb), window); |