aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-07-24 18:16:10 +0800
committerChristian Persch <chpe@src.gnome.org>2004-07-24 18:16:10 +0800
commitaf8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed (patch)
treee92bd101d32468f46208992e5bade9ad2bdc2280 /embed/mozilla/mozilla-embed.cpp
parent4d4808cdc6c565dbdefea90b567b3efe9718c5c4 (diff)
downloadgsoc2013-epiphany-af8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed.tar
gsoc2013-epiphany-af8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed.tar.gz
gsoc2013-epiphany-af8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed.tar.bz2
gsoc2013-epiphany-af8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed.tar.lz
gsoc2013-epiphany-af8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed.tar.xz
gsoc2013-epiphany-af8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed.tar.zst
gsoc2013-epiphany-af8bbdbc5bc95e1e3cd3fc6fc49f9f1e3eea91ed.zip
Refactores storing the security info, move it into EphyBrowser.
2004-07-24 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: Refactores storing the security info, move it into EphyBrowser.
Diffstat (limited to 'embed/mozilla/mozilla-embed.cpp')
-rw-r--r--embed/mozilla/mozilla-embed.cpp51
1 files changed, 10 insertions, 41 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index cdbd4ea8c..6f5f84f7d 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -38,16 +38,10 @@
#include <nsEmbedString.h>
#include <nsMemory.h>
#include <nsIURI.h>
-#include <nsIChannel.h>
#include <nsIRequest.h>
#include <nsIWebProgressListener.h>
#include <nsGfxCIID.h>
-#ifdef ALLOW_PRIVATE_API
-/* not sure about this one */
-#include <nsITransportSecurityInfo.h>
-#endif
-
static void mozilla_embed_class_init (MozillaEmbedClass *klass);
static void mozilla_embed_init (MozillaEmbed *gs);
static void mozilla_embed_destroy (GtkObject *object);
@@ -92,8 +86,7 @@ typedef enum
struct MozillaEmbedPrivate
{
EphyBrowser *browser;
- nsCOMPtr<nsIRequest> request;
- gint security_state;
+ guint security_state;
MozillaEmbedLoadState load_state;
};
@@ -322,8 +315,6 @@ mozilla_embed_finalize (GObject *object)
embed->priv->browser = nsnull;
}
- embed->priv->request = nsnull;
-
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -644,41 +635,19 @@ impl_get_security_level (EphyEmbed *embed,
EmbedSecurityLevel *level,
char **description)
{
- nsresult result;
+ MozillaEmbedPrivate *mpriv = MOZILLA_EMBED (embed)->priv;
g_return_if_fail (description != NULL && level != NULL);
*description = NULL;
*level = STATE_IS_UNKNOWN;
- nsCOMPtr<nsIChannel> channel;
- channel = do_QueryInterface (MOZILLA_EMBED(embed)->priv->request,
- &result);
- if (NS_FAILED (result)) return;
-
- nsCOMPtr<nsISupports> info;
- result = channel->GetSecurityInfo(getter_AddRefs(info));
- if (NS_FAILED (result)) return;
-
- if (info)
- {
- nsCOMPtr<nsITransportSecurityInfo> secInfo(do_QueryInterface(info));
- if (!secInfo) return;
-
- PRUnichar *tooltip;
- result = secInfo->GetShortSecurityDescription(&tooltip);
- if (NS_FAILED (result)) return;
+ nsresult rv;
+ nsEmbedCString desc;
+ rv = mpriv->browser->GetSecurityDescription (desc);
+ if (NS_FAILED (rv)) return;
- if (tooltip)
- {
- nsEmbedCString cTooltip;
- NS_UTF16ToCString (nsEmbedString(tooltip),
- NS_CSTRING_ENCODING_UTF8, cTooltip);
- *description = g_strdup (cTooltip.get());
- nsMemory::Free (tooltip);
- }
- }
-
+ *description = g_strdup (desc.get());
*level = mozilla_embed_security_level (MOZILLA_EMBED (embed));
}
@@ -1107,13 +1076,13 @@ mozilla_embed_new_window_cb (GtkMozEmbed *embed,
static void
mozilla_embed_security_change_cb (GtkMozEmbed *embed,
- gpointer request,
- guint state,
+ gpointer requestptr,
+ guint state,
MozillaEmbed *membed)
{
EmbedSecurityLevel level;
- membed->priv->request = static_cast<nsIRequest*>(request);
+ membed->priv->browser->SetSecurityInfo (static_cast<nsIRequest*>(requestptr));
membed->priv->security_state = state;
level = mozilla_embed_security_level (membed);