diff --git a/mozilla/embedding/base/nsEmbedAPI.cpp b/mozilla/embedding/base/nsEmbedAPI.cpp index 3da8295ff93..d63ca86a2ea 100644 --- a/mozilla/embedding/base/nsEmbedAPI.cpp +++ b/mozilla/embedding/base/nsEmbedAPI.cpp @@ -25,6 +25,7 @@ #include "nsIServiceManager.h" #include "nsIEventQueueService.h" #include "nsIChromeRegistry.h" +#include "nsIAppStartupNotifier.h" #include "nsIStringBundle.h" #include "nsIDirectoryService.h" @@ -111,6 +112,11 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory, sRegistryInitializedFlag = PR_TRUE; } + nsCOMPtr mStartupNotifier = do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID, &rv); + if(NS_FAILED(rv)) + return rv; + mStartupNotifier->Observe(nsnull, APPSTARTUP_TOPIC, nsnull); + // Create the Event Queue for the UI thread... // // If an event queue already exists for the thread, then diff --git a/mozilla/embedding/components/Makefile.in b/mozilla/embedding/components/Makefile.in index c21533e9635..9e8806a1bc7 100644 --- a/mozilla/embedding/components/Makefile.in +++ b/mozilla/embedding/components/Makefile.in @@ -24,6 +24,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = windowwatcher build +DIRS = windowwatcher appstartup build include $(topsrcdir)/config/rules.mk diff --git a/mozilla/embedding/components/build/Makefile.in b/mozilla/embedding/components/build/Makefile.in index c5889b35879..3fe12c85aac 100644 --- a/mozilla/embedding/components/build/Makefile.in +++ b/mozilla/embedding/components/build/Makefile.in @@ -27,7 +27,7 @@ MODULE = embedcomponents LIBRARY_NAME = embedcomponents SHORT_LIBNAME = embedcmp IS_COMPONENT = 1 -REQUIRES = js xpcom string windowwatcher embed_base +REQUIRES = js xpcom string windowwatcher appstartupnotifier embed_base CPPSRCS = nsModule.cpp @@ -42,6 +42,7 @@ else SHARED_LIBRARY_LIBS = \ $(DIST)/lib/libwindowwatcher_s.$(LIB_SUFFIX) \ + $(DIST)/lib/libappstartupnotifier_s.$(LIB_SUFFIX) \ $(NULL) ifdef MOZ_PERF_METRICS @@ -52,6 +53,7 @@ endif LOCAL_INCLUDES = \ -I$(srcdir)/../windowwatcher/src \ + -I$(srcdir)/../appstartup/src \ $(NULL) EXTRA_DSO_LDOPTS = \ diff --git a/mozilla/embedding/components/build/makefile.win b/mozilla/embedding/components/build/makefile.win index 7919c349f4f..58cba14bf6a 100644 --- a/mozilla/embedding/components/build/makefile.win +++ b/mozilla/embedding/components/build/makefile.win @@ -36,10 +36,12 @@ LLIBS = \ $(DIST)\lib\js3250.lib \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\windowwatcher_s.lib \ + $(DIST)\lib\appstartupnotifier_s.lib \ $(NULL) INCS = $(INCS) \ -I$(DEPTH)\embedding\components\windowwatcher\src \ + -I$(DEPTH)\embedding\components\appstartup\src \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/embedding/components/build/nsModule.cpp b/mozilla/embedding/components/build/nsModule.cpp index 55465737957..ee2a9cdbda0 100644 --- a/mozilla/embedding/components/build/nsModule.cpp +++ b/mozilla/embedding/components/build/nsModule.cpp @@ -22,12 +22,15 @@ #include "nsIGenericFactory.h" #include "nsWindowWatcher.h" +#include "nsAppStartupNotifier.h" NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowWatcher, Init) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppStartupNotifier) static nsModuleComponentInfo components[] = { { "Window Watcher", NS_WINDOWWATCHER_CID, NS_WINDOWWATCHER_CONTRACTID, nsWindowWatcherConstructor }, + { NS_APPSTARTUPNOTIFIER_CLASSNAME, NS_APPSTARTUPNOTIFIER_CID, NS_APPSTARTUPNOTIFIER_CONTRACTID, nsAppStartupNotifierConstructor } }; NS_IMPL_NSGETMODULE("embedcomponents", components) diff --git a/mozilla/embedding/components/makefile.win b/mozilla/embedding/components/makefile.win index 79ded08ca50..6f343158981 100644 --- a/mozilla/embedding/components/makefile.win +++ b/mozilla/embedding/components/makefile.win @@ -22,6 +22,7 @@ DEPTH=..\.. DIRS= \ windowwatcher \ + appstartup \ build \ $(NULL) diff --git a/mozilla/embedding/tests/mfcembed/BrowserFrameGlue.cpp b/mozilla/embedding/tests/mfcembed/BrowserFrameGlue.cpp index 8a87dfd3736..b082aa33f98 100644 --- a/mozilla/embedding/tests/mfcembed/BrowserFrameGlue.cpp +++ b/mozilla/embedding/tests/mfcembed/BrowserFrameGlue.cpp @@ -289,14 +289,8 @@ PRBool CBrowserFrame::BrowserFrameGlueObj::CreateNewBrowserFrame(PRUint32 chrome // the proper window size. If this window were to be visible then you'll see // the window size changes on the screen causing an unappealing flicker // - // Changing the last param back to TRUE since the latest nsIEmbeddingSiteWindow - // changes have gotten rid of the SetVisibility() method which we were using - // to finally show the browser window. I think we need that functionality - // back in - // Chak - // Feb 2, 2001 - CBrowserFrame* pFrm = pApp->CreateNewBrowserFrame(chromeMask, x, y, cx, cy, PR_TRUE); + CBrowserFrame* pFrm = pApp->CreateNewBrowserFrame(chromeMask, x, y, cx, cy, PR_FALSE); if(!pFrm) return PR_FALSE; diff --git a/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp b/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp index eaffedc4d0c..dce35af65f6 100644 --- a/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp +++ b/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp @@ -359,10 +359,20 @@ NS_IMETHODIMP CBrowserImpl::SetTitle(const PRUnichar* aTitle) NS_IMETHODIMP CBrowserImpl::GetVisibility(PRBool *aVisibility) { - return NS_ERROR_NOT_IMPLEMENTED; + if(! m_pBrowserFrameGlue) + return NS_ERROR_FAILURE; + + m_pBrowserFrameGlue->GetBrowserFrameVisibility(aVisibility); + + return NS_OK; } NS_IMETHODIMP CBrowserImpl::SetVisibility(PRBool aVisibility) { - return NS_ERROR_NOT_IMPLEMENTED; + if(! m_pBrowserFrameGlue) + return NS_ERROR_FAILURE; + + m_pBrowserFrameGlue->ShowBrowserFrame(PR_TRUE); + + return NS_OK; }