diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-06-08 16:24:05 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-06-26 20:37:47 +0800 |
commit | 990ee247b9613724f764b1bca2ff721e5688fcd8 (patch) | |
tree | 43a7431a4905c0ca0757b4726b5bb36050a14696 /embed/ephy-about-handler.c | |
parent | d434d5dde2cb2cd239d8d38b3a369466677e84a4 (diff) | |
download | gsoc2013-epiphany-990ee247b9613724f764b1bca2ff721e5688fcd8.tar gsoc2013-epiphany-990ee247b9613724f764b1bca2ff721e5688fcd8.tar.gz gsoc2013-epiphany-990ee247b9613724f764b1bca2ff721e5688fcd8.tar.bz2 gsoc2013-epiphany-990ee247b9613724f764b1bca2ff721e5688fcd8.tar.lz gsoc2013-epiphany-990ee247b9613724f764b1bca2ff721e5688fcd8.tar.xz gsoc2013-epiphany-990ee247b9613724f764b1bca2ff721e5688fcd8.tar.zst gsoc2013-epiphany-990ee247b9613724f764b1bca2ff721e5688fcd8.zip |
Port plugins about handler to WebKit2
https://bugzilla.gnome.org/show_bug.cgi?id=678625
Diffstat (limited to 'embed/ephy-about-handler.c')
-rw-r--r-- | embed/ephy-about-handler.c | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c index c8d0bc697..12f0ad71e 100644 --- a/embed/ephy-about-handler.c +++ b/embed/ephy-about-handler.c @@ -51,12 +51,64 @@ read_css_style () } } +void +_ephy_about_handler_handle_plugins (GString *data_str, GList *plugin_list) +{ +#ifdef HAVE_WEBKIT2 + GList *p; + + read_css_style (); + + g_string_append_printf (data_str, "<head><title>%s</title>" \ + "<style type=\"text/css\">%s</style></head><body>", + _("Installed plugins"), + css_style); + + g_string_append_printf (data_str, "<h1>%s</h1>", _("Installed plugins")); + + for (p = plugin_list; p; p = p->next) { + WebKitPlugin *plugin = WEBKIT_PLUGIN (p->data); + GList *m, *mime_types; + + /* TODO: Enable/disable plugins in WebKit2 */ + g_string_append_printf (data_str, "<h2>%s</h2>%s<br>%s: <b>%s</b>" \ + "<table id=\"plugin-table\">" \ + " <thead><tr><th>%s</th><th>%s</th><th>%s</th></tr></thead><tbody>", + webkit_plugin_get_name (plugin), + webkit_plugin_get_description (plugin), + _("Enabled"), /*webkit_plugin_get_enabled (plugin)*/ TRUE ? _("Yes") : _("No"), + _("MIME type"), _("Description"), _("Suffixes")); + + mime_types = webkit_plugin_get_mime_info_list (plugin); + + for (m = mime_types; m; m = m->next) { + WebKitMimeInfo *mime_info = (WebKitMimeInfo *) m->data; + const gchar * const *extensions; + guint i; + + g_string_append_printf (data_str, "<tr><td>%s</td><td>%s</td><td>", + webkit_mime_info_get_mime_type (mime_info), + webkit_mime_info_get_description (mime_info)); + + extensions = webkit_mime_info_get_extensions (mime_info); + for (i = 0; extensions && extensions[i] != NULL; i++) + g_string_append_printf (data_str, "%s%c", extensions[i], + extensions[i + 1] ? ',' : ' '); + + g_string_append (data_str, "</td></tr>"); + } + + g_string_append (data_str, "</tbody></table>"); + } + + g_string_append (data_str, "</body>"); +#endif +} + static void ephy_about_handler_handle_plugins (GString *data_str) { -#ifdef HAVE_WEBKIT2 - /* TODO: Plugins */ -#else +#ifndef HAVE_WEBKIT2 WebKitWebPluginDatabase* database = webkit_get_web_plugin_database (); GSList *plugin_list, *p; |