зеркало из https://github.com/mozilla/pjs.git
Relanding 157597 - Make embedding base and examples use XPCOM Glue. r=adamlock, sr=rpotts
This commit is contained in:
Родитель
ea57df1261
Коммит
7d7abcf248
|
@ -66,6 +66,8 @@ endif
|
||||||
# static lib.
|
# static lib.
|
||||||
FORCE_STATIC_LIB = 1
|
FORCE_STATIC_LIB = 1
|
||||||
|
|
||||||
|
DEFINES += -DXPCOM_GLUE
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS)
|
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS)
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef XPCOM_GLUE
|
||||||
|
#include "nsXPCOMGlue.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsIComponentRegistrar.h"
|
#include "nsIComponentRegistrar.h"
|
||||||
#include "nsIAppStartupNotifier.h"
|
#include "nsIAppStartupNotifier.h"
|
||||||
|
@ -83,6 +87,11 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory,
|
||||||
if (!sXPCOMInitializedFlag)
|
if (!sXPCOMInitializedFlag)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef XPCOM_GLUE
|
||||||
|
// TODO: Need to be smarter about where exactly the xpcom library is.
|
||||||
|
XPCOMGlueStartup(nsnull);
|
||||||
|
#endif
|
||||||
// Initialise XPCOM
|
// Initialise XPCOM
|
||||||
NS_InitXPCOM2(&sServiceManager, mozBinDirectory, appFileLocProvider);
|
NS_InitXPCOM2(&sServiceManager, mozBinDirectory, appFileLocProvider);
|
||||||
|
|
||||||
|
@ -172,5 +181,8 @@ nsresult NS_TermEmbedding()
|
||||||
NS_ShutdownXPCOM(sServiceManager);
|
NS_ShutdownXPCOM(sServiceManager);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XPCOM_GLUE
|
||||||
|
XPCOMGlueShutdown();
|
||||||
|
#endif
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,10 +79,13 @@ CPPSRCS = \
|
||||||
guids.cpp \
|
guids.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
DEFINES += -DXPCOM_GLUE
|
||||||
|
|
||||||
|
# we still include xpcom directly since this control uses atoms and voidarray.
|
||||||
EXTRA_DSO_LDOPTS = \
|
EXTRA_DSO_LDOPTS = \
|
||||||
$(DIST)/lib/$(LIB_PREFIX)gkgfx.$(LIB_SUFFIX) \
|
|
||||||
$(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \
|
$(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \
|
||||||
$(MOZ_UNICHARUTIL_LIBS) \
|
$(MOZ_UNICHARUTIL_LIBS) \
|
||||||
|
$(XPCOM_GLUE_LIBS) \
|
||||||
$(XPCOM_LIBS) \
|
$(XPCOM_LIBS) \
|
||||||
$(NSPR_LIBS) \
|
$(NSPR_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
|
@ -24,6 +24,8 @@ srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
IS_COMPONENT = 1
|
||||||
|
|
||||||
MODULE = gtkembedmoz
|
MODULE = gtkembedmoz
|
||||||
REQUIRES = xpcom \
|
REQUIRES = xpcom \
|
||||||
|
@ -67,6 +69,7 @@ EXTRA_LIBS += $(EXTRA_DSO_LIBS) $(STATIC_EXTRA_LIBS)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
EXTRA_LIBS += $(MOZ_JS_LIBS)
|
EXTRA_LIBS += $(MOZ_JS_LIBS)
|
||||||
EXTRA_LIBS += $(MOZ_COMPONENT_LIBS)
|
EXTRA_LIBS += $(MOZ_COMPONENT_LIBS)
|
||||||
|
|
||||||
|
@ -82,6 +85,13 @@ endif
|
||||||
EXTRA_LIBS += \
|
EXTRA_LIBS += \
|
||||||
$(TK_LIBS) \
|
$(TK_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
DEFINES += -DXPCOM_GLUE
|
||||||
|
|
||||||
|
LIBS += \
|
||||||
|
$(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \
|
||||||
|
$(XPCOM_GLUE_LIBS) \
|
||||||
|
$(NSPR_LIBS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), SunOS)
|
ifeq ($(OS_ARCH), SunOS)
|
||||||
ifndef GNU_CC
|
ifndef GNU_CC
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
// mozilla specific headers
|
// mozilla specific headers
|
||||||
#include "nsIDOMKeyEvent.h"
|
#include "nsIDOMKeyEvent.h"
|
||||||
|
|
|
@ -86,11 +86,13 @@ CPPSRCS = \
|
||||||
StdAfx.cpp \
|
StdAfx.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_DSO_LIBS = embed_base_s gkgfx mfcEmbedComponents
|
EXTRA_DSO_LIBS = mfcEmbedComponents
|
||||||
|
|
||||||
|
DEFINES += -DXPCOM_GLUE
|
||||||
|
|
||||||
LIBS = \
|
LIBS = \
|
||||||
$(EXTRA_DSO_LIBS) \
|
$(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \
|
||||||
$(XPCOM_LIBS) \
|
$(XPCOM_GLUE_LIBS) \
|
||||||
$(NSPR_LIBS) \
|
$(NSPR_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
#include "nsIWindowWatcher.h"
|
#include "nsIWindowWatcher.h"
|
||||||
#include "plstr.h"
|
#include "plstr.h"
|
||||||
#include "Preferences.h"
|
#include "Preferences.h"
|
||||||
#include "nsCRT.h"
|
#include "nsIComponentRegistrar.h"
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
@ -220,6 +220,12 @@ nsresult CMfcEmbedApp::OverrideComponents()
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
|
|
||||||
|
nsCOMPtr<nsIComponentRegistrar> registrar;
|
||||||
|
rv = NS_GetComponentRegistrar(getter_AddRefs(registrar));
|
||||||
|
if (NS_FAILED(rv))
|
||||||
|
return rv;
|
||||||
|
|
||||||
// replace Mozilla's default PromptService with our own, if the
|
// replace Mozilla's default PromptService with our own, if the
|
||||||
// expected override DLL is present
|
// expected override DLL is present
|
||||||
HMODULE overlib = ::LoadLibrary(kComponentsLibname);
|
HMODULE overlib = ::LoadLibrary(kComponentsLibname);
|
||||||
|
@ -235,11 +241,10 @@ nsresult CMfcEmbedApp::OverrideComponents()
|
||||||
nsCOMPtr<nsIFactory> promptFactory;
|
nsCOMPtr<nsIFactory> promptFactory;
|
||||||
rv = MakeFactory(getter_AddRefs(promptFactory));
|
rv = MakeFactory(getter_AddRefs(promptFactory));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
nsComponentManager::RegisterFactory(kPromptServiceCID,
|
registrar->RegisterFactory(kPromptServiceCID,
|
||||||
"Prompt Service",
|
"Prompt Service",
|
||||||
"@mozilla.org/embedcomp/prompt-service;1",
|
"@mozilla.org/embedcomp/prompt-service;1",
|
||||||
promptFactory,
|
promptFactory); // replace existing
|
||||||
PR_TRUE); // replace existing
|
|
||||||
} else
|
} else
|
||||||
::FreeLibrary(overlib);
|
::FreeLibrary(overlib);
|
||||||
}
|
}
|
||||||
|
@ -258,11 +263,10 @@ nsresult CMfcEmbedApp::OverrideComponents()
|
||||||
nsCOMPtr<nsIFactory> helperAppDlgFactory;
|
nsCOMPtr<nsIFactory> helperAppDlgFactory;
|
||||||
rv = MakeFactory(getter_AddRefs(helperAppDlgFactory));
|
rv = MakeFactory(getter_AddRefs(helperAppDlgFactory));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
nsComponentManager::RegisterFactory(kHelperAppLauncherDialogCID,
|
registrar->RegisterFactory(kHelperAppLauncherDialogCID,
|
||||||
"Helper App Launcher Dialog",
|
"Helper App Launcher Dialog",
|
||||||
"@mozilla.org/helperapplauncherdialog;1",
|
"@mozilla.org/helperapplauncherdialog;1",
|
||||||
helperAppDlgFactory,
|
helperAppDlgFactory);
|
||||||
PR_TRUE); // replace existing
|
|
||||||
} else
|
} else
|
||||||
::FreeLibrary(overlib);
|
::FreeLibrary(overlib);
|
||||||
}
|
}
|
||||||
|
@ -282,11 +286,10 @@ nsresult CMfcEmbedApp::OverrideComponents()
|
||||||
nsCOMPtr<nsIFactory> printingPromptFactory;
|
nsCOMPtr<nsIFactory> printingPromptFactory;
|
||||||
rv = MakeFactory(getter_AddRefs(printingPromptFactory));
|
rv = MakeFactory(getter_AddRefs(printingPromptFactory));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
nsComponentManager::RegisterFactory(kPrintingPromptServiceCID,
|
registrar->RegisterFactory(kPrintingPromptServiceCID,
|
||||||
"Printing Prompt Service",
|
"Printing Prompt Service",
|
||||||
"@mozilla.org/embedcomp/printingprompt-service;1",
|
"@mozilla.org/embedcomp/printingprompt-service;1",
|
||||||
printingPromptFactory,
|
printingPromptFactory);
|
||||||
PR_TRUE); // replace existing
|
|
||||||
} else
|
} else
|
||||||
::FreeLibrary(overlib);
|
::FreeLibrary(overlib);
|
||||||
}
|
}
|
||||||
|
@ -702,7 +705,7 @@ NS_IMETHODIMP CMfcEmbedApp::Observe(nsISupports *aSubject, const char *aTopic, c
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
if (nsCRT::strcmp(aTopic, "profile-approve-change") == 0)
|
if (strcmp(aTopic, "profile-approve-change") == 0)
|
||||||
{
|
{
|
||||||
// Ask the user if they want to
|
// Ask the user if they want to
|
||||||
int result = MessageBox(NULL, "Do you want to close all windows in order to switch the profile?", "Confirm", MB_YESNO | MB_ICONQUESTION);
|
int result = MessageBox(NULL, "Do you want to close all windows in order to switch the profile?", "Confirm", MB_YESNO | MB_ICONQUESTION);
|
||||||
|
@ -713,7 +716,7 @@ NS_IMETHODIMP CMfcEmbedApp::Observe(nsISupports *aSubject, const char *aTopic, c
|
||||||
status->VetoChange();
|
status->VetoChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(aTopic, "profile-change-teardown") == 0)
|
else if (strcmp(aTopic, "profile-change-teardown") == 0)
|
||||||
{
|
{
|
||||||
// Close all open windows. Alternatively, we could just call CBrowserWindow::Stop()
|
// Close all open windows. Alternatively, we could just call CBrowserWindow::Stop()
|
||||||
// on each. Either way, we have to stop all network activity on this phase.
|
// on each. Either way, we have to stop all network activity on this phase.
|
||||||
|
@ -734,13 +737,13 @@ NS_IMETHODIMP CMfcEmbedApp::Observe(nsISupports *aSubject, const char *aTopic, c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(aTopic, "profile-after-change") == 0)
|
else if (strcmp(aTopic, "profile-after-change") == 0)
|
||||||
{
|
{
|
||||||
InitializePrefs(); // In case we have just switched to a newly created profile.
|
InitializePrefs(); // In case we have just switched to a newly created profile.
|
||||||
|
|
||||||
// Only make a new browser window on a switch. This also gets
|
// Only make a new browser window on a switch. This also gets
|
||||||
// called at start up and we already make a window then.
|
// called at start up and we already make a window then.
|
||||||
if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("switch").get()))
|
if (!strcmp(someData, NS_LITERAL_STRING("switch").get()))
|
||||||
OnNewBrowser();
|
OnNewBrowser();
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
|
|
|
@ -124,6 +124,28 @@ private:
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
static PRInt32 strcmp(const PRUnichar* s1, const PRUnichar* s2) {
|
||||||
|
if(s1 && s2) {
|
||||||
|
for (;;) {
|
||||||
|
PRUnichar c1 = *s1++;
|
||||||
|
PRUnichar c2 = *s2++;
|
||||||
|
if (c1 != c2) {
|
||||||
|
if (c1 < c2) return -1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ((0==c1) || (0==c2)) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (s1) // s2 must have been null
|
||||||
|
return -1;
|
||||||
|
if (s2) // s1 must have been null
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//{{AFX_INSERT_LOCATION}}
|
//{{AFX_INSERT_LOCATION}}
|
||||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
// Mozilla
|
// Mozilla
|
||||||
#include "nsIProfile.h"
|
#include "nsIProfile.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define new DEBUG_NEW
|
#define new DEBUG_NEW
|
||||||
|
@ -228,7 +227,7 @@ BOOL CProfilesDlg::OnInitDialog()
|
||||||
{
|
{
|
||||||
CString tmpStr(W2T(profileList[index]));
|
CString tmpStr(W2T(profileList[index]));
|
||||||
m_ProfileList.AddString(tmpStr);
|
m_ProfileList.AddString(tmpStr);
|
||||||
if (nsCRT::strcmp(profileList[index], curProfileName.get()) == 0)
|
if (strcmp(profileList[index], curProfileName.get()) == 0)
|
||||||
selectedRow = index;
|
selectedRow = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ static NS_DEFINE_IID(kPrinterEnumeratorCID, NS_PRINTER_ENUMERATOR_CID);
|
||||||
#include "nsRect.h"
|
#include "nsRect.h"
|
||||||
|
|
||||||
#include "nsIPref.h"
|
#include "nsIPref.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "prenv.h" /* for PR_GetEnv */
|
#include "prenv.h" /* for PR_GetEnv */
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -837,6 +836,17 @@ static PRUnichar * GetDefaultPrinterNameFromGlobalPrinters()
|
||||||
return printerName;
|
return printerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PRUint32 strlen(const PRUnichar* s)
|
||||||
|
{
|
||||||
|
PRUint32 len = 0;
|
||||||
|
if(s) {
|
||||||
|
while (*s++ != 0) {
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Displays the native Print Dialog
|
// Displays the native Print Dialog
|
||||||
|
@ -866,7 +876,7 @@ ShowNativePrintDialog(HWND aHWnd,
|
||||||
if (!printerName) return NS_ERROR_FAILURE;
|
if (!printerName) return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
// Now create a DEVNAMES struct so the the dialog is initialized correctly.
|
// Now create a DEVNAMES struct so the the dialog is initialized correctly.
|
||||||
PRUint32 len = nsCRT::strlen(printerName);
|
PRUint32 len = strlen(printerName);
|
||||||
hDevNames = (HGLOBAL)::GlobalAlloc(GHND, len+sizeof(DEVNAMES)+1);
|
hDevNames = (HGLOBAL)::GlobalAlloc(GHND, len+sizeof(DEVNAMES)+1);
|
||||||
DEVNAMES* pDevNames = (DEVNAMES*)::GlobalLock(hDevNames);
|
DEVNAMES* pDevNames = (DEVNAMES*)::GlobalLock(hDevNames);
|
||||||
pDevNames->wDriverOffset = sizeof(DEVNAMES);
|
pDevNames->wDriverOffset = sizeof(DEVNAMES);
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include "nsILocalFile.h"
|
#include "nsILocalFile.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -92,23 +91,23 @@ winEmbedFileLocProvider::GetFile(const char *prop, PRBool *persistant, nsIFile *
|
||||||
*_retval = nsnull;
|
*_retval = nsnull;
|
||||||
*persistant = PR_TRUE;
|
*persistant = PR_TRUE;
|
||||||
|
|
||||||
if (nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0)
|
if (strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = GetProductDirectory(getter_AddRefs(localFile));
|
rv = GetProductDirectory(getter_AddRefs(localFile));
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_FILE) == 0)
|
else if (strcmp(prop, NS_APP_APPLICATION_REGISTRY_FILE) == 0)
|
||||||
{
|
{
|
||||||
rv = GetProductDirectory(getter_AddRefs(localFile));
|
rv = GetProductDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
rv = localFile->AppendNative(APP_REGISTRY_NAME);
|
rv = localFile->AppendNative(APP_REGISTRY_NAME);
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_DEFAULTS_50_DIR) == 0)
|
else if (strcmp(prop, NS_APP_DEFAULTS_50_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_PREF_DEFAULTS_50_DIR) == 0)
|
else if (strcmp(prop, NS_APP_PREF_DEFAULTS_50_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
@ -117,8 +116,8 @@ winEmbedFileLocProvider::GetFile(const char *prop, PRBool *persistant, nsIFile *
|
||||||
rv = localFile->AppendRelativeNativePath(DEFAULTS_PREF_DIR_NAME);
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_PREF_DIR_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0 ||
|
else if (strcmp(prop, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0 ||
|
||||||
nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0)
|
strcmp(prop, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
@ -127,29 +126,29 @@ winEmbedFileLocProvider::GetFile(const char *prop, PRBool *persistant, nsIFile *
|
||||||
rv = localFile->AppendRelativeNativePath(DEFAULTS_PROFILE_DIR_NAME);
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_PROFILE_DIR_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_USER_PROFILES_ROOT_DIR) == 0)
|
else if (strcmp(prop, NS_APP_USER_PROFILES_ROOT_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = GetDefaultUserProfileRoot(getter_AddRefs(localFile));
|
rv = GetDefaultUserProfileRoot(getter_AddRefs(localFile));
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_RES_DIR) == 0)
|
else if (strcmp(prop, NS_APP_RES_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
rv = localFile->AppendRelativeNativePath(RES_DIR_NAME);
|
rv = localFile->AppendRelativeNativePath(RES_DIR_NAME);
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_CHROME_DIR) == 0)
|
else if (strcmp(prop, NS_APP_CHROME_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
rv = localFile->AppendRelativeNativePath(CHROME_DIR_NAME);
|
rv = localFile->AppendRelativeNativePath(CHROME_DIR_NAME);
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR) == 0)
|
else if (strcmp(prop, NS_APP_PLUGINS_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
|
rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
|
||||||
}
|
}
|
||||||
else if (nsCRT::strcmp(prop, NS_APP_SEARCH_DIR) == 0)
|
else if (strcmp(prop, NS_APP_SEARCH_DIR) == 0)
|
||||||
{
|
{
|
||||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
|
|
|
@ -62,11 +62,11 @@ CPPSRCS = \
|
||||||
StdAfx.cpp \
|
StdAfx.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_DSO_LIBS = embed_base_s gkgfx
|
DEFINES += -DXPCOM_GLUE
|
||||||
|
|
||||||
LIBS = \
|
LIBS = \
|
||||||
$(EXTRA_DSO_LIBS) \
|
$(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \
|
||||||
$(XPCOM_LIBS) \
|
$(XPCOM_GLUE_LIBS) \
|
||||||
$(NSPR_LIBS) \
|
$(NSPR_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче