aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/mozilla-embed-persist.cpp3
-rw-r--r--embed/mozilla/mozilla-embed.cpp20
2 files changed, 13 insertions, 10 deletions
diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp
index c0c8cb06e..9f9ac185c 100644
--- a/embed/mozilla/mozilla-embed-persist.cpp
+++ b/embed/mozilla/mozilla-embed-persist.cpp
@@ -167,7 +167,8 @@ impl_save (EphyEmbedPersist *persist)
if (embed)
{
- wrapper = (EphyWrapper *) mozilla_embed_get_galeon_wrapper (MOZILLA_EMBED(embed));
+ wrapper = (EphyWrapper *) mozilla_embed_get_galeon_wrapper (MOZILLA_EMBED(embed));
+ g_return_val_if_fail (wrapper != NULL, G_FAILED);
wrapper->GetDOMWindow (getter_AddRefs (parent));
}
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 66330db4a..8c39dd460 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -274,7 +274,7 @@ mozilla_embed_get_type (void)
static const GInterfaceInfo embed_info =
{
- (GInterfaceInitFunc) ephy_embed_init, /* interface_init */
+ (GInterfaceInitFunc) ephy_embed_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
@@ -357,8 +357,6 @@ mozilla_embed_init (MozillaEmbed *embed)
gpointer
mozilla_embed_get_galeon_wrapper (MozillaEmbed *embed)
{
- g_return_val_if_fail (embed->priv->wrapper != NULL, NULL);
-
return embed->priv->wrapper;
}
@@ -719,6 +717,8 @@ impl_get_location (EphyEmbed *embed,
}
*location = l;
+
+ if (l == NULL) return G_FAILED;
return G_OK;
}
@@ -1309,14 +1309,16 @@ mozilla_embed_visibility_cb (GtkMozEmbed *embed, gboolean visibility,
(do_GetService(WINDOWWATCHER_CONTRACTID, &rv));
if (NS_FAILED(rv) || !wwatch) return;
- EphyWrapper *wrapper = (EphyWrapper *)mozilla_embed_get_galeon_wrapper(membed);
- if(!wrapper) return;
+ EphyWrapper *wrapper = membed->priv->wrapper;
- nsCOMPtr<nsIDOMWindow> domWindow;
- rv = wrapper->GetDOMWindow(getter_AddRefs(domWindow));
- if(NS_FAILED(rv) || !domWindow) return;
+ if (wrapper)
+ {
+ nsCOMPtr<nsIDOMWindow> domWindow;
+ rv = wrapper->GetDOMWindow(getter_AddRefs(domWindow));
+ if(NS_FAILED(rv) || !domWindow) return;
- rv = wwatch->SetActiveWindow(domWindow);
+ rv = wwatch->SetActiveWindow(domWindow);
+ }
}
static void