[epiphany] about-handler: Use ephy-resource for the incognito icon in about:incognito



commit e6e14af0840fe896a62e3b2a8629c0625895ddd2
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Fri Feb 21 10:06:54 2014 +0100

    about-handler: Use ephy-resource for the incognito icon in about:incognito
    
    Instead of decoding the image and send it to the web process.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724862

 embed/ephy-about-handler.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)
---
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
index b133df3..0cf76ca 100644
--- a/embed/ephy-about-handler.c
+++ b/embed/ephy-about-handler.c
@@ -502,23 +502,11 @@ static gboolean
 ephy_about_handler_handle_incognito (EphyAboutHandler *handler,
                                      WebKitURISchemeRequest *request)
 {
-  GBytes *img_data;
-  char *img_data_base64 = NULL;
   char *data;
-  GError *error;
 
   if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_INCOGNITO)
     return FALSE;
 
-  img_data = g_resources_lookup_data ("/org/gnome/epiphany/incognito.png", 0, &error);
-  if (img_data != NULL) {
-    img_data_base64 = g_base64_encode ((guchar*)g_bytes_get_data (img_data, NULL),
-                                       g_bytes_get_size (img_data));
-  } else {
-    g_debug ("%s", error->message);
-    g_error_free (error);
-  }
-
   data = g_strdup_printf ("<html>\n"                                   \
                           "<div dir=\"%s\">\n"                         \
                           "<head>\n"                                   \
@@ -528,7 +516,7 @@ ephy_about_handler_handle_incognito (EphyAboutHandler *handler,
                           "</head>\n"                                  \
                           "<body class=\"incognito-body\">\n"          \
                           "  <div id=\"mainblock\">\n"                 \
-                          "    <div style=\"background: transparent url(data:image/png;base64,%s) no-repeat 
10px center;\">\n" \
+                          "    <div style=\"background: transparent 
url(ephy-resource:///org/gnome/epiphany/incognito.png) no-repeat 10px center;\">\n" \
                           "      <h1>%s</h1>\n"                        \
                           "      <p>%s</p>\n"                          \
                           "    </div>\n"                               \
@@ -539,15 +527,11 @@ ephy_about_handler_handle_incognito (EphyAboutHandler *handler,
                           gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL ? "rtl" : "ltr",
                           _("Private Browsing"),
                           ephy_about_handler_get_style_sheet (handler),
-                          img_data_base64 ? img_data_base64 : "",
                           _("Private Browsing"),
                           _("You are currently browsing <em>incognito</em>. Pages viewed in this "
                             "mode will not show up in your browsing history and all stored "
                             "information will be cleared when you close the window."));
 
-  g_free (img_data_base64);
-  g_bytes_unref (img_data);
-
   ephy_about_handler_finish_request (request, data, -1);
 
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]