aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed-single.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-06-13 04:25:09 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-06-13 04:25:09 +0800
commitb59ab61dde301128d88778045f502cc30008bf8f (patch)
tree57dd181d409b16ca5abe7d2bddac9c3c54219e95 /embed/mozilla/mozilla-embed-single.cpp
parentdecb30ea6768b634476d351f3d5f5e73e4308326 (diff)
downloadgsoc2013-epiphany-b59ab61dde301128d88778045f502cc30008bf8f.tar.gz
gsoc2013-epiphany-b59ab61dde301128d88778045f502cc30008bf8f.tar.zst
gsoc2013-epiphany-b59ab61dde301128d88778045f502cc30008bf8f.zip
Add a way to open new windows passing features and uri. Something like js
2004-06-12 Marco Pesenti Gritti <marco@gnome.org> * embed/ephy-embed-single.c: (ephy_embed_single_open_window): * embed/ephy-embed-single.h: * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/EventContext.cpp: * embed/mozilla/mozilla-embed-single.cpp: Add a way to open new windows passing features and uri. Something like js window.open. It's necessary for popup blocker.
Diffstat (limited to 'embed/mozilla/mozilla-embed-single.cpp')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 522767150..bf74c9305 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -40,6 +40,7 @@
#include "ephy-embed-prefs.h"
#include "MozRegisterComponents.h"
#include "EphySingle.h"
+#include "EphyBrowser.h"
#include "EphyUtils.h"
#include <glib/gi18n.h>
@@ -50,6 +51,7 @@
#include <nsEmbedString.h>
#include <nsIPrefService.h>
#include <nsIServiceManager.h>
+#include <nsIWindowWatcher.h>
#include <nsIIOService.h>
#include <nsISupportsPrimitives.h>
#include <nsICookieManager.h>
@@ -838,6 +840,27 @@ impl_permission_manager_list (EphyPermissionManager *manager,
return list;
}
+void
+mozilla_embed_single_open_window (EphyEmbedSingle *single,
+ EphyEmbed *parent,
+ const char *address,
+ const char *features)
+{
+ nsCOMPtr<nsIDOMWindow> domWindow;
+ if (parent)
+ {
+ EphyBrowser *browser;
+
+ browser = (EphyBrowser *) _mozilla_embed_get_ephy_browser (MOZILLA_EMBED(parent));
+ g_return_if_fail (browser != NULL);
+
+ browser->GetDOMWindow (getter_AddRefs (domWindow));
+ }
+
+ nsCOMPtr<nsIWindowWatcher> wWatch(do_GetService ("@mozilla.org/embedcomp/window-watcher;1"));
+ wWatch->OpenWindow (domWindow, address, "", features, nsnull, nsnull);
+}
+
static void
mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass)
{