aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2007-10-09 02:35:47 +0800
committerChristian Persch <chpe@src.gnome.org>2007-10-09 02:35:47 +0800
commit5bab0972ef7fb33da8b1000d049dc12638f73d9e (patch)
tree71ee35e5d45ab1f43ee8d55dcf8d25357231e6da /embed
parentf9fc60cc505114328f9fbf5b4dd480f4087ff51c (diff)
downloadgsoc2013-epiphany-5bab0972ef7fb33da8b1000d049dc12638f73d9e.tar
gsoc2013-epiphany-5bab0972ef7fb33da8b1000d049dc12638f73d9e.tar.gz
gsoc2013-epiphany-5bab0972ef7fb33da8b1000d049dc12638f73d9e.tar.bz2
gsoc2013-epiphany-5bab0972ef7fb33da8b1000d049dc12638f73d9e.tar.lz
gsoc2013-epiphany-5bab0972ef7fb33da8b1000d049dc12638f73d9e.tar.xz
gsoc2013-epiphany-5bab0972ef7fb33da8b1000d049dc12638f73d9e.tar.zst
gsoc2013-epiphany-5bab0972ef7fb33da8b1000d049dc12638f73d9e.zip
Fix code style.
svn path=/trunk/; revision=7523
Diffstat (limited to 'embed')
-rw-r--r--embed/xulrunner/utils/ggeAutoModalDialog.cpp17
-rw-r--r--embed/xulrunner/utils/ggeAutoModalDialog.h2
2 files changed, 9 insertions, 10 deletions
diff --git a/embed/xulrunner/utils/ggeAutoModalDialog.cpp b/embed/xulrunner/utils/ggeAutoModalDialog.cpp
index 76029d2f3..761e871d9 100644
--- a/embed/xulrunner/utils/ggeAutoModalDialog.cpp
+++ b/embed/xulrunner/utils/ggeAutoModalDialog.cpp
@@ -51,13 +51,12 @@ ggeAutoModalDialog::ggeAutoModalDialog (nsIDOMWindow *aWindow,
: mWindow (aWindow),
mPWindow (do_QueryInterface (aWindow)),
mStack (do_GetService ("@mozilla.org/js/xpc/ContextStack;1")),
- mDefaultEnabled (PR_TRUE),
+ mDefaultEnabled (DispatchEvent ("DOMWillOpenModalDialog", aNotifyDOM)),
mContextPushed (PR_FALSE),
mModalStateSet (PR_FALSE)
{
/* First we check whether we should show the dialogue at all */
if (aNotifyDOM) {
- mDefaultEnabled = DispatchEvent ("DOMWillOpenModalDialog");
if (!mDefaultEnabled) {
return;
}
@@ -139,13 +138,12 @@ ggeAutoModalDialog::Run (GtkWidget *aDialog)
G_CALLBACK (DeleteCallback),
reinterpret_cast<void*>(this));
-
nsCOMPtr<nsIThread> thread (do_GetCurrentThread ());
NS_ASSERTION (thread, "No UI thread?");
mContinueModalLoop = PR_TRUE;
while (mContinueModalLoop) {
- if (!NS_ProcessNextEvent(thread))
+ if (!NS_ProcessNextEvent (thread))
break;
}
@@ -157,9 +155,10 @@ ggeAutoModalDialog::Run (GtkWidget *aDialog)
}
PRBool
-ggeAutoModalDialog::DispatchEvent (const char *aEventName)
+ggeAutoModalDialog::DispatchEvent (const char *aEventName,
+ PRBool aDoNotify)
{
- if (!mWindow) {
+ if (!mWindow || !aDoNotify) {
return PR_TRUE;
}
@@ -172,7 +171,7 @@ ggeAutoModalDialog::DispatchEvent (const char *aEventName)
PRBool defaultActionEnabled = PR_TRUE;
if (docevent) {
- docevent->CreateEvent(NS_LITERAL_STRING ("Events"), getter_AddRefs (event));
+ docevent->CreateEvent (NS_LITERAL_STRING ("Events"), getter_AddRefs (event));
nsCOMPtr<nsIPrivateDOMEvent> privateEvent (do_QueryInterface (event));
if (privateEvent) {
@@ -180,9 +179,9 @@ ggeAutoModalDialog::DispatchEvent (const char *aEventName)
privateEvent->SetTrusted(PR_TRUE);
- nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mWindow));
+ nsCOMPtr<nsIDOMEventTarget> target (do_QueryInterface (mWindow));
- target->DispatchEvent(event, &defaultActionEnabled);
+ target->DispatchEvent (event, &defaultActionEnabled);
}
}
diff --git a/embed/xulrunner/utils/ggeAutoModalDialog.h b/embed/xulrunner/utils/ggeAutoModalDialog.h
index 0c9da0fcd..07299b609 100644
--- a/embed/xulrunner/utils/ggeAutoModalDialog.h
+++ b/embed/xulrunner/utils/ggeAutoModalDialog.h
@@ -50,7 +50,7 @@ class ggeAutoModalDialog
// stack only please
void *operator new (size_t) CPP_THROW_NEW;
- PRBool DispatchEvent (const char *aEventName);
+ PRBool DispatchEvent (const char*, PRBool);
static void PR_CALLBACK ResponseCallback (GtkWidget*, int, void*);
static gboolean PR_CALLBACK DeleteCallback (GtkWidget*, void*, void*);