зеркало из https://github.com/mozilla/pjs.git
Remaining Fixes for #68720 - EmbedAPI should use generic startup observers
r=ccarlen,sr=alecf Fix for #71994 MfcEMbed must implement Get/SetVisibility of nsIEmbeddingSiteWindow r=chak
This commit is contained in:
Родитель
11395be532
Коммит
2406b1c4ee
|
@ -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<nsIObserver> 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
|
||||
|
|
|
@ -24,6 +24,6 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = windowwatcher build
|
||||
DIRS = windowwatcher appstartup build
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -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 = \
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -22,6 +22,7 @@ DEPTH=..\..
|
|||
|
||||
DIRS= \
|
||||
windowwatcher \
|
||||
appstartup \
|
||||
build \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче