зеркало из https://github.com/mozilla/pjs.git
Bug 345517 - Build Firefox --enable-libxul by default, r=darin/mento
This commit is contained in:
Родитель
3bdb7cb317
Коммит
1aa947c723
17
Makefile.in
17
Makefile.in
|
@ -289,19 +289,16 @@ ifdef MOZ_JAVAXPCOM
|
||||||
tier_50_dirs += extensions/java
|
tier_50_dirs += extensions/java
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef BUILD_STATIC_LIBS
|
ifneq (1_,$(BUILD_STATIC_LIBS)_$(MOZ_META_COMPONENT))
|
||||||
ifdef MOZ_XUL_APP
|
ifdef MOZ_XUL_APP
|
||||||
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
|
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
|
||||||
tier_50_dirs += embedding/browser/gtk
|
tier_50_dirs += embedding/browser/gtk
|
||||||
endif
|
endif # GTK
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef MOZ_XUL_APP
|
|
||||||
ifndef BUILD_STATIC_LIBS
|
|
||||||
tier_50_dirs += toolkit/library
|
tier_50_dirs += toolkit/library
|
||||||
endif
|
|
||||||
endif
|
endif # MOZ_XUL_APP
|
||||||
|
endif # STATIC
|
||||||
|
|
||||||
ifdef MOZ_ENABLE_LIBXUL
|
ifdef MOZ_ENABLE_LIBXUL
|
||||||
tier_50_dirs += xpcom/stub
|
tier_50_dirs += xpcom/stub
|
||||||
|
@ -454,6 +451,10 @@ ifdef ENABLE_TESTS
|
||||||
tier_99_dirs += tools/test-harness
|
tier_99_dirs += tools/test-harness
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef MOZ_META_COMPONENT
|
||||||
|
tier_99_dirs += modules/staticmod
|
||||||
|
endif
|
||||||
|
|
||||||
# This should be built last, after all IDL files in the tree have been processed
|
# This should be built last, after all IDL files in the tree have been processed
|
||||||
ifdef MOZ_JAVAXPCOM
|
ifdef MOZ_JAVAXPCOM
|
||||||
tier_99_dirs += extensions/java/xpcom/interfaces
|
tier_99_dirs += extensions/java/xpcom/interfaces
|
||||||
|
|
|
@ -97,17 +97,6 @@ CPPSRCS = nsBrowserApp.cpp
|
||||||
|
|
||||||
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
||||||
|
|
||||||
ifdef BUILD_STATIC_LIBS
|
|
||||||
STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
|
|
||||||
LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
|
|
||||||
else
|
|
||||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
|
||||||
LIBS += $(DIST)/bin/XUL
|
|
||||||
else
|
|
||||||
EXTRA_DSO_LIBS += xul
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||||
TK_LIBS := -framework Cocoa $(TK_LIBS)
|
TK_LIBS := -framework Cocoa $(TK_LIBS)
|
||||||
endif
|
endif
|
||||||
|
@ -117,7 +106,6 @@ EXTRA_DSO_LIBS += thebes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBS += \
|
LIBS += \
|
||||||
$(STATIC_COMPONENTS_LINKER_PATH) \
|
|
||||||
$(EXTRA_DSO_LIBS) \
|
$(EXTRA_DSO_LIBS) \
|
||||||
$(MOZ_JS_LIBS) \
|
$(MOZ_JS_LIBS) \
|
||||||
$(XPCOM_LIBS) \
|
$(XPCOM_LIBS) \
|
||||||
|
@ -148,25 +136,11 @@ endif
|
||||||
NSDISTMODE = copy
|
NSDISTMODE = copy
|
||||||
|
|
||||||
include $(topsrcdir)/config/config.mk
|
include $(topsrcdir)/config/config.mk
|
||||||
ifndef BUILD_STATIC_LIBS
|
|
||||||
|
|
||||||
ifdef NS_TRACE_MALLOC
|
ifdef NS_TRACE_MALLOC
|
||||||
EXTRA_DSO_LIBS += tracemalloc
|
EXTRA_DSO_LIBS += tracemalloc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else
|
|
||||||
include $(topsrcdir)/config/static-config.mk
|
|
||||||
|
|
||||||
EXTRA_DEPS += \
|
|
||||||
$(STATIC_EXTRA_DEPS) \
|
|
||||||
$(NULL)
|
|
||||||
DEFINES += $(STATIC_DEFINES)
|
|
||||||
CPPSRCS += $(STATIC_CPPSRCS)
|
|
||||||
EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
|
|
||||||
REQUIRES += $(STATIC_REQUIRES)
|
|
||||||
EXTRA_LIBS += $(STATIC_EXTRA_LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
|
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
|
||||||
ifdef MOZ_ENABLE_CAIRO_GFX
|
ifdef MOZ_ENABLE_CAIRO_GFX
|
||||||
|
@ -179,9 +153,6 @@ RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
|
||||||
else
|
else
|
||||||
RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
|
RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
|
||||||
endif
|
endif
|
||||||
ifdef BUILD_STATIC_LIBS
|
|
||||||
RCFLAGS += -DMOZ_STATIC_BUILD
|
|
||||||
endif
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
RCFLAGS += -DDEBUG
|
RCFLAGS += -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
@ -189,18 +160,11 @@ endif
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),BeOS)
|
ifeq ($(OS_ARCH),BeOS)
|
||||||
BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc
|
BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc
|
||||||
ifdef BUILD_STATIC_LIBS
|
|
||||||
OS_LIBS += -ltracker -lgame
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),OS2)
|
ifeq ($(OS_ARCH),OS2)
|
||||||
RESFILE=splashos2.res
|
RESFILE=splashos2.res
|
||||||
RCFLAGS += -DMOZ_PHOENIX
|
RCFLAGS += -DMOZ_PHOENIX
|
||||||
ifdef BUILD_STATIC_LIBS
|
|
||||||
EXE_DEF_FILE = browser.def
|
|
||||||
RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include/widget
|
|
||||||
endif
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
RCFLAGS += -DDEBUG
|
RCFLAGS += -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
@ -211,21 +175,6 @@ include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
DEFINES += -DFIREFOX_ICO=\"$(DIST)/branding/firefox.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
|
DEFINES += -DFIREFOX_ICO=\"$(DIST)/branding/firefox.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
|
||||||
|
|
||||||
ifdef BUILD_STATIC_LIBS
|
|
||||||
include $(topsrcdir)/config/static-rules.mk
|
|
||||||
|
|
||||||
DEFINES += -DIMPL_XREAPI
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
|
||||||
ifdef BUILD_STATIC_LIBS
|
|
||||||
LIBS += -framework QuickTime -framework IOKit
|
|
||||||
ifdef USE_PREBINDING
|
|
||||||
BIN_FLAGS += -Wl,-headerpad -Wl,5a0c
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
|
ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
|
||||||
LIBS += -lphexlib
|
LIBS += -lphexlib
|
||||||
endif
|
endif
|
||||||
|
@ -248,20 +197,6 @@ endif
|
||||||
|
|
||||||
$(PROGRAM): $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
|
$(PROGRAM): $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),OS2)
|
|
||||||
ifdef BUILD_STATIC_LIBS
|
|
||||||
$(EXE_DEF_FILE):
|
|
||||||
rm -f $@
|
|
||||||
@echo NAME mozilla >$(EXE_DEF_FILE)
|
|
||||||
@echo IMPORTS >>$(EXE_DEF_FILE)
|
|
||||||
@echo WinQueryProperty = PMMERGE.5450 >>$(EXE_DEF_FILE)
|
|
||||||
@echo WinRemoveProperty = PMMERGE.5451 >>$(EXE_DEF_FILE)
|
|
||||||
@echo WinSetProperty = PMMERGE.5452 >>$(EXE_DEF_FILE)
|
|
||||||
|
|
||||||
LDFLAGS += -Zlinker /NOE
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
||||||
|
|
||||||
firefox:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
|
firefox:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
|
||||||
|
|
|
@ -11,7 +11,6 @@ SHORT_LIBNAME = brwsrcmp
|
||||||
EXPORT_LIBRARY = 1
|
EXPORT_LIBRARY = 1
|
||||||
IS_COMPONENT = 1
|
IS_COMPONENT = 1
|
||||||
MODULE_NAME = nsBrowserCompsModule
|
MODULE_NAME = nsBrowserCompsModule
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
|
|
||||||
REQUIRES = \
|
REQUIRES = \
|
||||||
xpcom \
|
xpcom \
|
||||||
|
@ -76,17 +75,12 @@ LOCAL_INCLUDES += -I$(srcdir)/../safebrowsing/src
|
||||||
SHARED_LIBRARY_LIBS += ../safebrowsing/src/$(LIB_PREFIX)safebrowsing_s.$(LIB_SUFFIX)
|
SHARED_LIBRARY_LIBS += ../safebrowsing/src/$(LIB_PREFIX)safebrowsing_s.$(LIB_SUFFIX)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Link to gkgfx for GNOME shell service
|
|
||||||
ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2)
|
|
||||||
EXTRA_DSO_LIBS += gkgfx
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DSO_LDOPTS += \
|
EXTRA_DSO_LDOPTS += \
|
||||||
$(LIBS_DIR) \
|
$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
|
||||||
$(EXTRA_DSO_LIBS) \
|
|
||||||
$(MOZ_UNICHARUTIL_LIBS) \
|
$(MOZ_UNICHARUTIL_LIBS) \
|
||||||
$(LIBXUL_DIST)/../modules/libreg/src/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX) \
|
$(LIBXUL_DIST)/../modules/libreg/src/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX) \
|
||||||
$(MOZ_JS_LIBS) \
|
$(MOZ_JS_LIBS) \
|
||||||
|
$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
|
||||||
$(MOZ_COMPONENT_LIBS) \
|
$(MOZ_COMPONENT_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ endif
|
||||||
IS_COMPONENT = 1
|
IS_COMPONENT = 1
|
||||||
MODULE_NAME = BrowserDirProvider
|
MODULE_NAME = BrowserDirProvider
|
||||||
EXPORT_LIBRARY = 1
|
EXPORT_LIBRARY = 1
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
|
|
||||||
REQUIRES = \
|
REQUIRES = \
|
||||||
xpcom \
|
xpcom \
|
||||||
|
@ -61,6 +60,9 @@ REQUIRES = \
|
||||||
|
|
||||||
CPPSRCS = nsBrowserDirectoryProvider.cpp
|
CPPSRCS = nsBrowserDirectoryProvider.cpp
|
||||||
|
|
||||||
EXTRA_DSO_LDOPTS = $(MOZ_COMPONENT_LIBS)
|
EXTRA_DSO_LDOPTS = \
|
||||||
|
$(XPCOM_GLUE_LDOPTS) \
|
||||||
|
$(NSPR_LIBS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
|
@ -48,9 +48,12 @@
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
#include "nsCategoryManagerUtils.h"
|
#include "nsCategoryManagerUtils.h"
|
||||||
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsCOMArray.h"
|
#include "nsCOMArray.h"
|
||||||
|
#include "nsDirectoryServiceUtils.h"
|
||||||
#include "nsIGenericFactory.h"
|
#include "nsIGenericFactory.h"
|
||||||
#include "nsString.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
|
#include "nsStringAPI.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
class nsBrowserDirectoryProvider :
|
class nsBrowserDirectoryProvider :
|
||||||
|
@ -118,7 +121,7 @@ nsBrowserDirectoryProvider::GetFile(const char *aKey, PRBool *aPersist,
|
||||||
|
|
||||||
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||||
if (prefs) {
|
if (prefs) {
|
||||||
nsXPIDLCString path;
|
nsCString path;
|
||||||
rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path));
|
rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path));
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
NS_NewNativeLocalFile(path, PR_TRUE, (nsILocalFile**)(nsIFile**) getter_AddRefs(file));
|
NS_NewNativeLocalFile(path, PR_TRUE, (nsILocalFile**)(nsIFile**) getter_AddRefs(file));
|
||||||
|
|
|
@ -58,6 +58,4 @@ LOCAL_INCLUDES = -I$(srcdir)/../../build
|
||||||
|
|
||||||
FORCE_STATIC_LIB = 1
|
FORCE_STATIC_LIB = 1
|
||||||
|
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
|
@ -42,13 +42,14 @@
|
||||||
#include "nsNetCID.h"
|
#include "nsNetCID.h"
|
||||||
#include "nsXPCOM.h"
|
#include "nsXPCOM.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsString.h"
|
|
||||||
#include "nsStringStream.h"
|
#include "nsStringStream.h"
|
||||||
|
|
||||||
#include "nsBrowserCompsCID.h"
|
#include "nsBrowserCompsCID.h"
|
||||||
|
|
||||||
#include "nsICategoryManager.h"
|
#include "nsICategoryManager.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
|
#include "nsComponentManagerUtils.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
#include "nsIStreamConverterService.h"
|
#include "nsIStreamConverterService.h"
|
||||||
#include "nsIStreamConverter.h"
|
#include "nsIStreamConverter.h"
|
||||||
|
@ -96,9 +97,12 @@ nsFeedSniffer::ConvertEncodedData(nsIRequest* request,
|
||||||
|
|
||||||
converter->OnStartRequest(request, nsnull);
|
converter->OnStartRequest(request, nsnull);
|
||||||
|
|
||||||
nsCOMPtr<nsIInputStream> rawStream;
|
nsCOMPtr<nsIStringInputStream> rawStream =
|
||||||
rv = NS_NewByteInputStream(getter_AddRefs(rawStream),
|
do_CreateInstance(NS_STRINGINPUTSTREAM_CONTRACTID);
|
||||||
(const char*)data, length);
|
if (!rawStream)
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
rv = rawStream->SetData((const char*)data, length);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = converter->OnDataAvailable(request, nsnull, rawStream, 0, length);
|
rv = converter->OnDataAvailable(request, nsnull, rawStream, 0, length);
|
||||||
|
@ -167,40 +171,24 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request,
|
||||||
length = MAX_BYTES;
|
length = MAX_BYTES;
|
||||||
|
|
||||||
// Thus begins the actual sniffing.
|
// Thus begins the actual sniffing.
|
||||||
nsDependentCSubstring dataString((const char*)testData,
|
nsDependentCSubstring dataString((const char*)testData, length);
|
||||||
(const char*)testData + length);
|
|
||||||
nsACString::const_iterator start_iter, end_iter;
|
|
||||||
|
|
||||||
PRBool isFeed = PR_FALSE;
|
PRBool isFeed = PR_FALSE;
|
||||||
|
|
||||||
// RSS 0.91/0.92/2.0
|
// RSS 0.91/0.92/2.0
|
||||||
dataString.BeginReading(start_iter);
|
|
||||||
dataString.EndReading(end_iter);
|
|
||||||
|
|
||||||
isFeed = FindInReadable(NS_LITERAL_CSTRING("<rss"), start_iter, end_iter);
|
isFeed = dataString.Find("<rss") != -1;
|
||||||
|
|
||||||
// Atom 1.0
|
// Atom 1.0
|
||||||
if (!isFeed) {
|
if (!isFeed) {
|
||||||
dataString.BeginReading(start_iter);
|
isFeed = dataString.Find("<feed") != -1;
|
||||||
dataString.EndReading(end_iter);
|
|
||||||
isFeed = FindInReadable(NS_LITERAL_CSTRING("<feed"), start_iter, end_iter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RSS 1.0
|
// RSS 1.0
|
||||||
if (!isFeed) {
|
if (!isFeed) {
|
||||||
dataString.BeginReading(start_iter);
|
isFeed = dataString.Find("<rdf:RDF") != -1 &&
|
||||||
dataString.EndReading(end_iter);
|
dataString.Find(NS_RDF) != -1 &&
|
||||||
isFeed = FindInReadable(NS_LITERAL_CSTRING("<rdf:RDF"), start_iter, end_iter);
|
dataString.Find(NS_RSS) != -1;
|
||||||
if (isFeed) {
|
|
||||||
dataString.BeginReading(start_iter);
|
|
||||||
dataString.EndReading(end_iter);
|
|
||||||
isFeed = FindInReadable(NS_LITERAL_CSTRING(NS_RDF), start_iter, end_iter);
|
|
||||||
if (isFeed) {
|
|
||||||
dataString.BeginReading(start_iter);
|
|
||||||
dataString.EndReading(end_iter);
|
|
||||||
isFeed = FindInReadable(NS_LITERAL_CSTRING(NS_RSS), start_iter, end_iter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we sniffed a feed, coerce our internal type
|
// If we sniffed a feed, coerce our internal type
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "nsIGenericFactory.h"
|
#include "nsIGenericFactory.h"
|
||||||
#include "nsIContentSniffer.h"
|
#include "nsIContentSniffer.h"
|
||||||
#include "nsIStreamListener.h"
|
#include "nsIStreamListener.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsFeedSniffer : public nsIContentSniffer, nsIStreamListener
|
class nsFeedSniffer : public nsIContentSniffer, nsIStreamListener
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,6 @@ include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
MODULE = migration
|
MODULE = migration
|
||||||
LIBRARY_NAME = migration_s
|
LIBRARY_NAME = migration_s
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
|
|
||||||
REQUIRES = \
|
REQUIRES = \
|
||||||
xpcom \
|
xpcom \
|
||||||
|
@ -63,7 +62,7 @@ REQUIRES = \
|
||||||
docshell \
|
docshell \
|
||||||
xulapp \
|
xulapp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef MOZ_PLACES
|
ifdef MOZ_PLACES
|
||||||
REQUIRES += places
|
REQUIRES += places
|
||||||
else
|
else
|
||||||
|
|
|
@ -96,9 +96,10 @@ void SetProxyPref(const nsAString& aHostPort, const char* aPref,
|
||||||
if (portDelimOffset > 0) {
|
if (portDelimOffset > 0) {
|
||||||
SetUnicharPref(aPref, Substring(hostPort, 0, portDelimOffset), aPrefs);
|
SetUnicharPref(aPref, Substring(hostPort, 0, portDelimOffset), aPrefs);
|
||||||
nsAutoString port(Substring(hostPort, portDelimOffset + 1));
|
nsAutoString port(Substring(hostPort, portDelimOffset + 1));
|
||||||
PRInt32 stringErr;
|
nsresult stringErr;
|
||||||
portValue = port.ToInteger(&stringErr);
|
portValue = port.ToInteger(&stringErr);
|
||||||
aPrefs->SetIntPref(aPortPref, portValue);
|
if (NS_SUCCEEDED(stringErr))
|
||||||
|
aPrefs->SetIntPref(aPortPref, portValue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SetUnicharPref(aPref, hostPort, aPrefs);
|
SetUnicharPref(aPref, hostPort, aPrefs);
|
||||||
|
@ -268,11 +269,11 @@ ImportBookmarksHTML(nsIFile* aBookmarksFile,
|
||||||
rv = bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
rv = bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsXPIDLString sourceName;
|
nsString sourceName;
|
||||||
bundle->GetStringFromName(aImportSourceNameKey, getter_Copies(sourceName));
|
bundle->GetStringFromName(aImportSourceNameKey, getter_Copies(sourceName));
|
||||||
|
|
||||||
const PRUnichar* sourceNameStrings[] = { sourceName.get() };
|
const PRUnichar* sourceNameStrings[] = { sourceName.get() };
|
||||||
nsXPIDLString importedBookmarksTitle;
|
nsString importedBookmarksTitle;
|
||||||
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
||||||
sourceNameStrings, 1,
|
sourceNameStrings, 1,
|
||||||
getter_Copies(importedBookmarksTitle));
|
getter_Copies(importedBookmarksTitle));
|
||||||
|
|
|
@ -60,7 +60,9 @@
|
||||||
|
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
class nsIProfileStartup;
|
class nsIProfileStartup;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// nsCaminoProfileMigrator
|
// nsCaminoProfileMigrator
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "nsIBrowserProfileMigrator.h"
|
#include "nsIBrowserProfileMigrator.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsCaminoProfileMigrator : public nsIBrowserProfileMigrator
|
class nsCaminoProfileMigrator : public nsIBrowserProfileMigrator
|
||||||
{
|
{
|
||||||
|
@ -58,4 +58,4 @@ private:
|
||||||
nsCOMPtr<nsIObserverService> mObserverService;
|
nsCOMPtr<nsIObserverService> mObserverService;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
|
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsBrowserProfileMigratorUtils.h"
|
#include "nsBrowserProfileMigratorUtils.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsDogbertProfileMigrator.h"
|
#include "nsDogbertProfileMigrator.h"
|
||||||
#include "nsICookieManager2.h"
|
#include "nsICookieManager2.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
|
@ -53,12 +52,12 @@
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "nsNetCID.h"
|
#include "nsNetCID.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsReadableUtils.h"
|
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
#include "nsEscape.h"
|
|
||||||
#include "NSReg.h"
|
#include "NSReg.h"
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
|
#include "nsDirectoryServiceUtils.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifndef MAXPATHLEN
|
#ifndef MAXPATHLEN
|
||||||
#ifdef _MAX_PATH
|
#ifdef _MAX_PATH
|
||||||
|
@ -289,7 +288,7 @@ nsDogbertProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||||
if (!mProfiles) {
|
if (!mProfiles) {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
rv = NS_NewISupportsArray(getter_AddRefs(mProfiles));
|
mProfiles = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsIFile> regFile;
|
nsCOMPtr<nsIFile> regFile;
|
||||||
|
@ -361,7 +360,7 @@ nsDogbertProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||||
|
|
||||||
mSourceProfile = profileFile;
|
mSourceProfile = profileFile;
|
||||||
|
|
||||||
rv = NS_NewISupportsArray(getter_AddRefs(mProfiles));
|
mProfiles = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsISupportsString> nameString
|
nsCOMPtr<nsISupportsString> nameString
|
||||||
|
@ -566,7 +565,7 @@ nsDogbertProfileMigrator::FixDogbertCookies()
|
||||||
|
|
||||||
// skip line if it is a comment or null line
|
// skip line if it is a comment or null line
|
||||||
if (buffer.IsEmpty() || buffer.CharAt(0) == '#' ||
|
if (buffer.IsEmpty() || buffer.CharAt(0) == '#' ||
|
||||||
buffer.CharAt(0) == nsCRT::CR || buffer.CharAt(0) == nsCRT::LF) {
|
buffer.CharAt(0) == '\r' || buffer.CharAt(0) == '\n') {
|
||||||
fileOutputStream->Write(buffer.get(), buffer.Length(), &written);
|
fileOutputStream->Write(buffer.get(), buffer.Length(), &written);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -583,15 +582,17 @@ nsDogbertProfileMigrator::FixDogbertCookies()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// separate the expires field from the rest of the cookie line
|
// separate the expires field from the rest of the cookie line
|
||||||
nsCAutoString prefix, expiresString, suffix;
|
const nsDependentCSubstring prefix =
|
||||||
buffer.Mid(prefix, hostIndex, expiresIndex-hostIndex-1);
|
Substring(buffer, hostIndex, expiresIndex-hostIndex-1);
|
||||||
buffer.Mid(expiresString, expiresIndex, nameIndex-expiresIndex-1);
|
const nsDependentCSubstring expiresString =
|
||||||
buffer.Mid(suffix, nameIndex, buffer.Length()-nameIndex);
|
Substring(buffer, expiresIndex, nameIndex-expiresIndex-1);
|
||||||
|
const nsDependentCSubstring suffix =
|
||||||
|
Substring(buffer, nameIndex, buffer.Length()-nameIndex);
|
||||||
|
|
||||||
// correct the expires field
|
// correct the expires field
|
||||||
char* expiresCString = ToNewCString(expiresString);
|
char* expiresCString = ToNewCString(expiresString);
|
||||||
unsigned long expires = strtoul(expiresCString, nsnull, 10);
|
unsigned long expires = strtoul(expiresCString, nsnull, 10);
|
||||||
nsCRT::free(expiresCString);
|
NS_Free(expiresCString);
|
||||||
|
|
||||||
// if the cookie is supposed to expire at the end of the session
|
// if the cookie is supposed to expire at the end of the session
|
||||||
// expires == 0. don't adjust those cookies.
|
// expires == 0. don't adjust those cookies.
|
||||||
|
@ -643,7 +644,7 @@ nsDogbertProfileMigrator::MigrateDogbertBookmarks()
|
||||||
dogbertPrefsFile->Append(PREF_FILE_NAME_IN_4x);
|
dogbertPrefsFile->Append(PREF_FILE_NAME_IN_4x);
|
||||||
psvc->ReadUserPrefs(dogbertPrefsFile);
|
psvc->ReadUserPrefs(dogbertPrefsFile);
|
||||||
|
|
||||||
nsXPIDLCString toolbarName;
|
nsCString toolbarName;
|
||||||
nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc));
|
nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc));
|
||||||
rv = branch->GetCharPref("custtoolbar.personal_toolbar_folder", getter_Copies(toolbarName));
|
rv = branch->GetCharPref("custtoolbar.personal_toolbar_folder", getter_Copies(toolbarName));
|
||||||
// If the pref wasn't set in the user's 4.x preferences, there's no way we can "Fix" the
|
// If the pref wasn't set in the user's 4.x preferences, there's no way we can "Fix" the
|
||||||
|
@ -663,5 +664,5 @@ nsDogbertProfileMigrator::MigrateDogbertBookmarks()
|
||||||
targetBookmarksFile->Append(BOOKMARKS_FILE_NAME_IN_5x);
|
targetBookmarksFile->Append(BOOKMARKS_FILE_NAME_IN_5x);
|
||||||
|
|
||||||
return AnnotatePersonalToolbarFolder(sourceBookmarksFile,
|
return AnnotatePersonalToolbarFolder(sourceBookmarksFile,
|
||||||
targetBookmarksFile, toolbarName);
|
targetBookmarksFile, toolbarName.get());
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsNetscapeProfileMigratorBase.h"
|
#include "nsNetscapeProfileMigratorBase.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
#define NEED_TO_FIX_4X_COOKIES 1
|
#define NEED_TO_FIX_4X_COOKIES 1
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// nsICabProfileMigrator
|
// nsICabProfileMigrator
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "nsIBrowserProfileMigrator.h"
|
#include "nsIBrowserProfileMigrator.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsICabProfileMigrator : public nsIBrowserProfileMigrator
|
class nsICabProfileMigrator : public nsIBrowserProfileMigrator
|
||||||
{
|
{
|
||||||
|
@ -58,4 +58,4 @@ private:
|
||||||
nsCOMPtr<nsIObserverService> mObserverService;
|
nsCOMPtr<nsIObserverService> mObserverService;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -45,12 +45,13 @@
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsBrowserProfileMigratorUtils.h"
|
#include "nsBrowserProfileMigratorUtils.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
#include "nsCRTGlue.h"
|
||||||
#include "nsNetCID.h"
|
#include "nsNetCID.h"
|
||||||
#include "nsDocShellCID.h"
|
#include "nsDocShellCID.h"
|
||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
#include "nsDependentString.h"
|
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
#include "nsString.h"
|
#include "nsDirectoryServiceUtils.h"
|
||||||
|
#include "nsStringAPI.h"
|
||||||
#include "plstr.h"
|
#include "plstr.h"
|
||||||
#include "prio.h"
|
#include "prio.h"
|
||||||
#include "prmem.h"
|
#include "prmem.h"
|
||||||
|
@ -91,7 +92,6 @@
|
||||||
#include "nsIBookmarksService.h"
|
#include "nsIBookmarksService.h"
|
||||||
#endif
|
#endif
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsToolkitCompsCID.h"
|
#include "nsToolkitCompsCID.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
|
@ -877,7 +877,7 @@ nsIEProfileMigrator::MigrateSiteAuthSignons(IPStore* aPStore)
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoString tmp(itemName);
|
nsAutoString tmp(itemName);
|
||||||
tmp.Truncate(6);
|
tmp.SetLength(6);
|
||||||
if (tmp.Equals(NS_LITERAL_STRING("DPAPI:"))) // often FTP logins
|
if (tmp.Equals(NS_LITERAL_STRING("DPAPI:"))) // often FTP logins
|
||||||
password = NULL; // We can't handle these yet
|
password = NULL; // We can't handle these yet
|
||||||
|
|
||||||
|
@ -920,9 +920,8 @@ nsIEProfileMigrator::GetSignonsListFromPStore(IPStore* aPStore, nsVoidArray* aSi
|
||||||
hr = aPStore->ReadItem(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, itemName, &count, &data, NULL, 0);
|
hr = aPStore->ReadItem(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, itemName, &count, &data, NULL, 0);
|
||||||
if (SUCCEEDED(hr) && data) {
|
if (SUCCEEDED(hr) && data) {
|
||||||
nsAutoString itemNameString(itemName);
|
nsAutoString itemNameString(itemName);
|
||||||
nsAutoString suffix;
|
if (StringTail(itemNameString, 11).
|
||||||
itemNameString.Right(suffix, 11);
|
LowerCaseEqualsLiteral(":stringdata")) {
|
||||||
if (suffix.EqualsIgnoreCase(":StringData")) {
|
|
||||||
// :StringData contains the saved data
|
// :StringData contains the saved data
|
||||||
const nsAString& key = Substring(itemNameString, 0, itemNameString.Length() - 11);
|
const nsAString& key = Substring(itemNameString, 0, itemNameString.Length() - 11);
|
||||||
char* realm = nsnull;
|
char* realm = nsnull;
|
||||||
|
@ -977,7 +976,7 @@ nsIEProfileMigrator::KeyIsURI(const nsAString& aKey, char** aRealm)
|
||||||
uri->GetHost(host);
|
uri->GetHost(host);
|
||||||
realm.Append(host);
|
realm.Append(host);
|
||||||
|
|
||||||
*aRealm = nsCRT::strdup(realm.get());
|
*aRealm = ToNewCString(realm);
|
||||||
return validScheme;
|
return validScheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1000,15 +999,14 @@ nsIEProfileMigrator::ResolveAndMigrateSignons(IPStore* aPStore, nsVoidArray* aSi
|
||||||
hr = aPStore->ReadItem(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, itemName, &count, &data, NULL, 0);
|
hr = aPStore->ReadItem(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, itemName, &count, &data, NULL, 0);
|
||||||
if (SUCCEEDED(hr) && data) {
|
if (SUCCEEDED(hr) && data) {
|
||||||
nsAutoString itemNameString(itemName);
|
nsAutoString itemNameString(itemName);
|
||||||
nsAutoString suffix;
|
if (StringTail(itemNameString, 11).
|
||||||
itemNameString.Right(suffix, 11);
|
LowerCaseEqualsLiteral(":stringdata")) {
|
||||||
if (suffix.EqualsIgnoreCase(":StringData")) {
|
|
||||||
// :StringData contains the saved data
|
// :StringData contains the saved data
|
||||||
const nsAString& key = Substring(itemNameString, 0, itemNameString.Length() - 11);
|
const nsAString& key = Substring(itemNameString, 0, itemNameString.Length() - 11);
|
||||||
|
|
||||||
// Assume all keys that are valid URIs are signons, not saved form data, and that
|
// Assume all keys that are valid URIs are signons, not saved form data, and that
|
||||||
// all keys that aren't valid URIs are form field names (containing form data).
|
// all keys that aren't valid URIs are form field names (containing form data).
|
||||||
nsXPIDLCString realm;
|
nsCString realm;
|
||||||
if (!KeyIsURI(key, getter_Copies(realm))) {
|
if (!KeyIsURI(key, getter_Copies(realm))) {
|
||||||
// Search the data for a username that matches one of the found signons.
|
// Search the data for a username that matches one of the found signons.
|
||||||
EnumerateUsernames(key, (PRUnichar*)data, (count/sizeof(PRUnichar)), aSignonsFound);
|
EnumerateUsernames(key, (PRUnichar*)data, (count/sizeof(PRUnichar)), aSignonsFound);
|
||||||
|
@ -1025,7 +1023,7 @@ nsIEProfileMigrator::ResolveAndMigrateSignons(IPStore* aPStore, nsVoidArray* aSi
|
||||||
for (PRInt32 i = 0; i < signonCount; ++i) {
|
for (PRInt32 i = 0; i < signonCount; ++i) {
|
||||||
SignonData* sd = (SignonData*)aSignonsFound->ElementAt(i);
|
SignonData* sd = (SignonData*)aSignonsFound->ElementAt(i);
|
||||||
::CoTaskMemFree(sd->user); // |sd->user| is a pointer to the start of a buffer that also contains sd->pass
|
::CoTaskMemFree(sd->user); // |sd->user| is a pointer to the start of a buffer that also contains sd->pass
|
||||||
nsCRT::free(sd->realm);
|
NS_Free(sd->realm);
|
||||||
delete sd;
|
delete sd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1128,12 +1126,11 @@ nsIEProfileMigrator::CopyFormData(PRBool aReplace)
|
||||||
hr = PStore->ReadItem(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, itemName, &count, &data, NULL, 0);
|
hr = PStore->ReadItem(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, itemName, &count, &data, NULL, 0);
|
||||||
if (SUCCEEDED(hr) && data) {
|
if (SUCCEEDED(hr) && data) {
|
||||||
nsAutoString itemNameString(itemName);
|
nsAutoString itemNameString(itemName);
|
||||||
nsAutoString suffix;
|
if (StringTail(itemNameString, 11).
|
||||||
itemNameString.Right(suffix, 11);
|
LowerCaseEqualsLiteral(":stringdata")) {
|
||||||
if (suffix.EqualsIgnoreCase(":StringData")) {
|
|
||||||
// :StringData contains the saved data
|
// :StringData contains the saved data
|
||||||
const nsAString& key = Substring(itemNameString, 0, itemNameString.Length() - 11);
|
const nsAString& key = Substring(itemNameString, 0, itemNameString.Length() - 11);
|
||||||
nsXPIDLCString realm;
|
nsCString realm;
|
||||||
if (!KeyIsURI(key, getter_Copies(realm))) {
|
if (!KeyIsURI(key, getter_Copies(realm))) {
|
||||||
nsresult rv = AddDataToFormHistory(key, (PRUnichar*)data, (count/sizeof(PRUnichar)));
|
nsresult rv = AddDataToFormHistory(key, (PRUnichar*)data, (count/sizeof(PRUnichar)));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
@ -1212,12 +1209,12 @@ nsIEProfileMigrator::CopyFavorites(PRBool aReplace) {
|
||||||
nsCOMPtr<nsIStringBundle> bundle;
|
nsCOMPtr<nsIStringBundle> bundle;
|
||||||
bundleService->CreateBundle(TRIDENTPROFILE_BUNDLE, getter_AddRefs(bundle));
|
bundleService->CreateBundle(TRIDENTPROFILE_BUNDLE, getter_AddRefs(bundle));
|
||||||
|
|
||||||
nsXPIDLString sourceNameIE;
|
nsString sourceNameIE;
|
||||||
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameIE").get(),
|
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameIE").get(),
|
||||||
getter_Copies(sourceNameIE));
|
getter_Copies(sourceNameIE));
|
||||||
|
|
||||||
const PRUnichar* sourceNameStrings[] = { sourceNameIE.get() };
|
const PRUnichar* sourceNameStrings[] = { sourceNameIE.get() };
|
||||||
nsXPIDLString importedIEFavsTitle;
|
nsString importedIEFavsTitle;
|
||||||
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
||||||
sourceNameStrings, 1, getter_Copies(importedIEFavsTitle));
|
sourceNameStrings, 1, getter_Copies(importedIEFavsTitle));
|
||||||
|
|
||||||
|
@ -1284,7 +1281,7 @@ nsIEProfileMigrator::CopySmartKeywords(nsIRDFResource* aParentFolder)
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<nsINavBookmarksService> bms(do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv));
|
nsCOMPtr<nsINavBookmarksService> bms(do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
PRInt64 keywordsFolder;
|
PRInt64 keywordsFolder = 0;
|
||||||
#else
|
#else
|
||||||
nsCOMPtr<nsIBookmarksService> bms(do_GetService("@mozilla.org/browser/bookmarks-service;1"));
|
nsCOMPtr<nsIBookmarksService> bms(do_GetService("@mozilla.org/browser/bookmarks-service;1"));
|
||||||
nsCOMPtr<nsIRDFResource> keywordsFolder, bookmark;
|
nsCOMPtr<nsIRDFResource> keywordsFolder, bookmark;
|
||||||
|
@ -1303,12 +1300,12 @@ nsIEProfileMigrator::CopySmartKeywords(nsIRDFResource* aParentFolder)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!keywordsFolder) {
|
if (!keywordsFolder) {
|
||||||
nsXPIDLString sourceNameIE;
|
nsString sourceNameIE;
|
||||||
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameIE").get(),
|
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameIE").get(),
|
||||||
getter_Copies(sourceNameIE));
|
getter_Copies(sourceNameIE));
|
||||||
|
|
||||||
const PRUnichar* sourceNameStrings[] = { sourceNameIE.get() };
|
const PRUnichar* sourceNameStrings[] = { sourceNameIE.get() };
|
||||||
nsXPIDLString importedIESearchUrlsTitle;
|
nsString importedIESearchUrlsTitle;
|
||||||
bundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchURLsFolder").get(),
|
bundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchURLsFolder").get(),
|
||||||
sourceNameStrings, 1, getter_Copies(importedIESearchUrlsTitle));
|
sourceNameStrings, 1, getter_Copies(importedIESearchUrlsTitle));
|
||||||
#ifdef MOZ_PLACES
|
#ifdef MOZ_PLACES
|
||||||
|
@ -1337,13 +1334,13 @@ nsIEProfileMigrator::CopySmartKeywords(nsIRDFResource* aParentFolder)
|
||||||
NS_ConvertUTF8toUTF16 host(hostCStr);
|
NS_ConvertUTF8toUTF16 host(hostCStr);
|
||||||
|
|
||||||
const PRUnichar* nameStrings[] = { host.get() };
|
const PRUnichar* nameStrings[] = { host.get() };
|
||||||
nsXPIDLString keywordName;
|
nsString keywordName;
|
||||||
nsresult rv = bundle->FormatStringFromName(
|
nsresult rv = bundle->FormatStringFromName(
|
||||||
NS_LITERAL_STRING("importedSearchURLsTitle").get(),
|
NS_LITERAL_STRING("importedSearchURLsTitle").get(),
|
||||||
nameStrings, 1, getter_Copies(keywordName));
|
nameStrings, 1, getter_Copies(keywordName));
|
||||||
|
|
||||||
const PRUnichar* descStrings[] = { keyName.get(), host.get() };
|
const PRUnichar* descStrings[] = { keyName.get(), host.get() };
|
||||||
nsXPIDLString keywordDesc;
|
nsString keywordDesc;
|
||||||
rv = bundle->FormatStringFromName(
|
rv = bundle->FormatStringFromName(
|
||||||
NS_LITERAL_STRING("importedSearchUrlDesc").get(),
|
NS_LITERAL_STRING("importedSearchUrlDesc").get(),
|
||||||
descStrings, 2, getter_Copies(keywordDesc));
|
descStrings, 2, getter_Copies(keywordDesc));
|
||||||
|
@ -1373,7 +1370,7 @@ nsIEProfileMigrator::CopySmartKeywords(nsIRDFResource* aParentFolder)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsIEProfileMigrator::ResolveShortcut(const nsAFlatString &aFileName, char** aOutURL)
|
nsIEProfileMigrator::ResolveShortcut(const nsString &aFileName, char** aOutURL)
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
|
|
||||||
|
@ -1467,8 +1464,8 @@ nsIEProfileMigrator::ParseFavoritesFolder(nsIFile* aDirectory,
|
||||||
NS_NAMED_LITERAL_STRING(lnkExt, ".lnk");
|
NS_NAMED_LITERAL_STRING(lnkExt, ".lnk");
|
||||||
PRInt32 lnkExtStart = bookmarkName.Length() - lnkExt.Length();
|
PRInt32 lnkExtStart = bookmarkName.Length() - lnkExt.Length();
|
||||||
if (StringEndsWith(bookmarkName, lnkExt,
|
if (StringEndsWith(bookmarkName, lnkExt,
|
||||||
nsCaseInsensitiveStringComparator()))
|
CaseInsensitiveCompare))
|
||||||
bookmarkName.Truncate(lnkExtStart);
|
bookmarkName.SetLength(lnkExtStart);
|
||||||
|
|
||||||
#ifdef MOZ_PLACES
|
#ifdef MOZ_PLACES
|
||||||
nsCOMPtr<nsIURI> bookmarkURI;
|
nsCOMPtr<nsIURI> bookmarkURI;
|
||||||
|
@ -1561,8 +1558,7 @@ nsIEProfileMigrator::ParseFavoritesFolder(nsIFile* aDirectory,
|
||||||
nsCAutoString extension;
|
nsCAutoString extension;
|
||||||
|
|
||||||
url->GetFileExtension(extension);
|
url->GetFileExtension(extension);
|
||||||
if (!extension.Equals(NS_LITERAL_CSTRING("url"),
|
if (!extension.Equals("url", CaseInsensitiveCompare))
|
||||||
nsCaseInsensitiveCStringComparator()))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
nsAutoString name(Substring(bookmarkName, 0,
|
nsAutoString name(Substring(bookmarkName, 0,
|
||||||
|
@ -1571,7 +1567,7 @@ nsIEProfileMigrator::ParseFavoritesFolder(nsIFile* aDirectory,
|
||||||
nsAutoString path;
|
nsAutoString path;
|
||||||
currFile->GetPath(path);
|
currFile->GetPath(path);
|
||||||
|
|
||||||
nsXPIDLCString resolvedURL;
|
nsCString resolvedURL;
|
||||||
ResolveShortcut(path, getter_Copies(resolvedURL));
|
ResolveShortcut(path, getter_Copies(resolvedURL));
|
||||||
|
|
||||||
#ifdef MOZ_PLACES
|
#ifdef MOZ_PLACES
|
||||||
|
@ -1719,7 +1715,7 @@ nsIEProfileMigrator::CopyCookies(PRBool aReplace)
|
||||||
nsCAutoString fileName;
|
nsCAutoString fileName;
|
||||||
cookieFile->GetNativeLeafName(fileName);
|
cookieFile->GetNativeLeafName(fileName);
|
||||||
const nsACString &fileOwner = Substring(fileName, 0, usernameLength);
|
const nsACString &fileOwner = Substring(fileName, 0, usernameLength);
|
||||||
if (!fileOwner.Equals(username, nsCaseInsensitiveCStringComparator()))
|
if (!fileOwner.Equals(username, CaseInsensitiveCompare))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ensure the contents buffer is large enough to hold the entire file
|
// ensure the contents buffer is large enough to hold the entire file
|
||||||
|
|
|
@ -89,7 +89,7 @@ protected:
|
||||||
nsresult AddDataToFormHistory(const nsAString& aKey, PRUnichar* data, unsigned long len);
|
nsresult AddDataToFormHistory(const nsAString& aKey, PRUnichar* data, unsigned long len);
|
||||||
|
|
||||||
nsresult CopyFavorites(PRBool aReplace);
|
nsresult CopyFavorites(PRBool aReplace);
|
||||||
void ResolveShortcut(const nsAFlatString &aFileName, char** aOutURL);
|
void ResolveShortcut(const nsString &aFileName, char** aOutURL);
|
||||||
#ifdef MOZ_PLACES
|
#ifdef MOZ_PLACES
|
||||||
nsresult ParseFavoritesFolder(nsIFile* aDirectory,
|
nsresult ParseFavoritesFolder(nsIFile* aDirectory,
|
||||||
PRInt64 aParentFolder,
|
PRInt64 aParentFolder,
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Ben Goodger <ben@bengoodger.com>
|
* Ben Goodger <ben@bengoodger.com>
|
||||||
|
* Benjamin Smedberg <benjamin@smedbergs.us>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
@ -45,6 +46,8 @@
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
#include "nsIProperties.h"
|
||||||
|
|
||||||
#define MACIE_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Favorites.html")
|
#define MACIE_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Favorites.html")
|
||||||
#define MACIE_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Explorer")
|
#define MACIE_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Explorer")
|
||||||
|
@ -196,7 +199,7 @@ nsMacIEProfileMigrator::CopyBookmarks(PRBool aReplace)
|
||||||
rv = bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
rv = bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsXPIDLString toolbarFolderNameMacIE;
|
nsString toolbarFolderNameMacIE;
|
||||||
bundle->GetStringFromName(NS_LITERAL_STRING("toolbarFolderNameMacIE").get(),
|
bundle->GetStringFromName(NS_LITERAL_STRING("toolbarFolderNameMacIE").get(),
|
||||||
getter_Copies(toolbarFolderNameMacIE));
|
getter_Copies(toolbarFolderNameMacIE));
|
||||||
nsCAutoString ctoolbarFolderNameMacIE;
|
nsCAutoString ctoolbarFolderNameMacIE;
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "nsIBrowserProfileMigrator.h"
|
#include "nsIBrowserProfileMigrator.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsMacIEProfileMigrator : public nsIBrowserProfileMigrator
|
class nsMacIEProfileMigrator : public nsIBrowserProfileMigrator
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
|
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsBrowserProfileMigratorUtils.h"
|
#include "nsBrowserProfileMigratorUtils.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsICookieManager2.h"
|
#include "nsICookieManager2.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
#include "nsILineInputStream.h"
|
#include "nsILineInputStream.h"
|
||||||
|
@ -52,8 +51,6 @@
|
||||||
#include "nsIURL.h"
|
#include "nsIURL.h"
|
||||||
#include "nsNetscapeProfileMigratorBase.h"
|
#include "nsNetscapeProfileMigratorBase.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsReadableUtils.h"
|
|
||||||
#include "nsXPIDLString.h"
|
|
||||||
#include "prtime.h"
|
#include "prtime.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
|
|
||||||
|
@ -175,8 +172,8 @@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistr
|
||||||
aProfileLocations->AppendElement(dir);
|
aProfileLocations->AppendElement(dir);
|
||||||
|
|
||||||
// Get the profile name and add it to the names array
|
// Get the profile name and add it to the names array
|
||||||
nsXPIDLString profileName;
|
nsString profileName;
|
||||||
CopyUTF8toUTF16(profileStr, profileName);
|
CopyUTF8toUTF16(nsDependentCString(profileStr), profileName);
|
||||||
|
|
||||||
nsCOMPtr<nsISupportsString> profileNameString(
|
nsCOMPtr<nsISupportsString> profileNameString(
|
||||||
do_CreateInstance("@mozilla.org/supports-string;1"));
|
do_CreateInstance("@mozilla.org/supports-string;1"));
|
||||||
|
@ -227,7 +224,7 @@ nsNetscapeProfileMigratorBase::GetWString(void* aTransform, nsIPrefBranch* aBran
|
||||||
getter_AddRefs(prefValue));
|
getter_AddRefs(prefValue));
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv) && prefValue) {
|
if (NS_SUCCEEDED(rv) && prefValue) {
|
||||||
nsXPIDLString data;
|
nsString data;
|
||||||
prefValue->ToString(getter_Copies(data));
|
prefValue->ToString(getter_Copies(data));
|
||||||
|
|
||||||
xform->stringValue = ToNewCString(NS_ConvertUTF16toUTF8(data));
|
xform->stringValue = ToNewCString(NS_ConvertUTF16toUTF8(data));
|
||||||
|
@ -242,7 +239,7 @@ nsNetscapeProfileMigratorBase::SetWStringFromASCII(void* aTransform, nsIPrefBran
|
||||||
PrefTransform* xform = (PrefTransform*)aTransform;
|
PrefTransform* xform = (PrefTransform*)aTransform;
|
||||||
if (xform->prefHasValue) {
|
if (xform->prefHasValue) {
|
||||||
nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));
|
nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));
|
||||||
nsAutoString data; data.AssignWithConversion(xform->stringValue);
|
NS_ConvertUTF8toUTF16 data(xform->stringValue);
|
||||||
pls->SetData(data.get());
|
pls->SetData(data.get());
|
||||||
return aBranch->SetComplexValue(xform->targetPrefName ? xform->targetPrefName : xform->sourcePrefName, NS_GET_IID(nsIPrefLocalizedString), pls);
|
return aBranch->SetComplexValue(xform->targetPrefName ? xform->targetPrefName : xform->sourcePrefName, NS_GET_IID(nsIPrefLocalizedString), pls);
|
||||||
}
|
}
|
||||||
|
@ -341,7 +338,6 @@ nsNetscapeProfileMigratorBase::ImportNetscapeCookies(nsIFile* aCookiesFile)
|
||||||
nsCAutoString buffer;
|
nsCAutoString buffer;
|
||||||
PRBool isMore = PR_TRUE;
|
PRBool isMore = PR_TRUE;
|
||||||
PRInt32 hostIndex = 0, isDomainIndex, pathIndex, secureIndex, expiresIndex, nameIndex, cookieIndex;
|
PRInt32 hostIndex = 0, isDomainIndex, pathIndex, secureIndex, expiresIndex, nameIndex, cookieIndex;
|
||||||
nsASingleFragmentCString::char_iterator iter;
|
|
||||||
PRInt32 numInts;
|
PRInt32 numInts;
|
||||||
PRInt64 expires;
|
PRInt64 expires;
|
||||||
PRBool isDomain;
|
PRBool isDomain;
|
||||||
|
@ -381,18 +377,19 @@ nsNetscapeProfileMigratorBase::ImportNetscapeCookies(nsIFile* aCookiesFile)
|
||||||
|
|
||||||
// check the expirytime first - if it's expired, ignore
|
// check the expirytime first - if it's expired, ignore
|
||||||
// nullstomp the trailing tab, to avoid copying the string
|
// nullstomp the trailing tab, to avoid copying the string
|
||||||
buffer.BeginWriting(iter);
|
char *iter = buffer.BeginWriting();
|
||||||
*(iter += nameIndex - 1) = char(0);
|
*(iter += nameIndex - 1) = char(0);
|
||||||
numInts = PR_sscanf(buffer.get() + expiresIndex, "%lld", &expires);
|
numInts = PR_sscanf(buffer.get() + expiresIndex, "%lld", &expires);
|
||||||
if (numInts != 1 || nsInt64(expires) < currentTime)
|
if (numInts != 1 || nsInt64(expires) < currentTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
isDomain = Substring(buffer, isDomainIndex, pathIndex - isDomainIndex - 1).Equals(kTrue);
|
isDomain = Substring(buffer, isDomainIndex, pathIndex - isDomainIndex - 1).Equals(kTrue);
|
||||||
const nsASingleFragmentCString &host = Substring(buffer, hostIndex, isDomainIndex - hostIndex - 1);
|
const nsDependentCSubstring host =
|
||||||
|
Substring(buffer, hostIndex, isDomainIndex - hostIndex - 1);
|
||||||
// check for bad legacy cookies (domain not starting with a dot, or containing a port),
|
// check for bad legacy cookies (domain not starting with a dot, or containing a port),
|
||||||
// and discard
|
// and discard
|
||||||
if (isDomain && !host.IsEmpty() && host.First() != '.' ||
|
if (isDomain && !host.IsEmpty() && host.First() != '.' ||
|
||||||
host.FindChar(':') != kNotFound)
|
host.FindChar(':') != -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// create a new nsCookie and assign the data.
|
// create a new nsCookie and assign the data.
|
||||||
|
@ -458,7 +455,7 @@ nsNetscapeProfileMigratorBase::LocateSignonsFile(char** aResult)
|
||||||
nsCAutoString extn;
|
nsCAutoString extn;
|
||||||
url->GetFileExtension(extn);
|
url->GetFileExtension(extn);
|
||||||
|
|
||||||
if (extn.EqualsIgnoreCase("s")) {
|
if (extn.Equals("s", CaseInsensitiveCompare)) {
|
||||||
url->GetFileName(fileName);
|
url->GetFileName(fileName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "nsILocalFile.h"
|
#include "nsILocalFile.h"
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsIFile;
|
class nsIFile;
|
||||||
class nsIPrefBranch;
|
class nsIPrefBranch;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Ben Goodger <ben@bengoodger.com>
|
* Ben Goodger <ben@bengoodger.com>
|
||||||
|
* Benjamin Smedberg <benjamin@smedbergs.us>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
@ -42,6 +43,7 @@
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// nsOmniWebProfileMigrator
|
// nsOmniWebProfileMigrator
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "nsIBrowserProfileMigrator.h"
|
#include "nsIBrowserProfileMigrator.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsOmniWebProfileMigrator : public nsIBrowserProfileMigrator
|
class nsOmniWebProfileMigrator : public nsIBrowserProfileMigrator
|
||||||
{
|
{
|
||||||
|
@ -58,4 +58,4 @@ private:
|
||||||
nsCOMPtr<nsIObserverService> mObserverService;
|
nsCOMPtr<nsIObserverService> mObserverService;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
|
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsBrowserProfileMigratorUtils.h"
|
#include "nsBrowserProfileMigratorUtils.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
|
#include "nsDirectoryServiceUtils.h"
|
||||||
#include "nsDocShellCID.h"
|
#include "nsDocShellCID.h"
|
||||||
#ifdef MOZ_PLACES
|
#ifdef MOZ_PLACES
|
||||||
#include "nsINavBookmarksService.h"
|
#include "nsINavBookmarksService.h"
|
||||||
|
@ -67,8 +67,6 @@
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsOperaProfileMigrator.h"
|
#include "nsOperaProfileMigrator.h"
|
||||||
#include "nsReadableUtils.h"
|
|
||||||
#include "nsString.h"
|
|
||||||
#include "nsToolkitCompsCID.h"
|
#include "nsToolkitCompsCID.h"
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -217,7 +215,9 @@ NS_IMETHODIMP
|
||||||
nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||||
{
|
{
|
||||||
if (!mProfiles) {
|
if (!mProfiles) {
|
||||||
nsresult rv = NS_NewISupportsArray(getter_AddRefs(mProfiles));
|
nsresult rv;
|
||||||
|
|
||||||
|
mProfiles = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
nsCOMPtr<nsIProperties> fileLocator(do_GetService("@mozilla.org/file/directory_service;1"));
|
nsCOMPtr<nsIProperties> fileLocator(do_GetService("@mozilla.org/file/directory_service;1"));
|
||||||
|
@ -379,7 +379,7 @@ nsOperaProfileMigrator::SetWString(void* aTransform, nsIPrefBranch* aBranch)
|
||||||
{
|
{
|
||||||
PrefTransform* xform = (PrefTransform*)aTransform;
|
PrefTransform* xform = (PrefTransform*)aTransform;
|
||||||
nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));
|
nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));
|
||||||
nsAutoString data; data.AssignWithConversion(xform->stringValue);
|
NS_ConvertASCIItoUTF16 data(xform->stringValue);
|
||||||
pls->SetData(data.get());
|
pls->SetData(data.get());
|
||||||
return aBranch->SetComplexValue(xform->targetPrefName, NS_GET_IID(nsIPrefLocalizedString), pls);
|
return aBranch->SetComplexValue(xform->targetPrefName, NS_GET_IID(nsIPrefLocalizedString), pls);
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ nsOperaProfileMigrator::CopyPreferences(PRBool aReplace)
|
||||||
transform->prefSetterFunc(transform, branch);
|
transform->prefSetterFunc(transform, branch);
|
||||||
}
|
}
|
||||||
if (colorString)
|
if (colorString)
|
||||||
nsCRT::free(colorString);
|
NS_Free(colorString);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nsCAutoString val;
|
nsCAutoString val;
|
||||||
|
@ -443,7 +443,7 @@ nsOperaProfileMigrator::CopyPreferences(PRBool aReplace)
|
||||||
transform->keyName,
|
transform->keyName,
|
||||||
val);
|
val);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
PRInt32 strerr;
|
nsresult strerr;
|
||||||
switch (transform->type) {
|
switch (transform->type) {
|
||||||
case _OPM(STRING):
|
case _OPM(STRING):
|
||||||
transform->stringValue = ToNewCString(val);
|
transform->stringValue = ToNewCString(val);
|
||||||
|
@ -462,7 +462,7 @@ nsOperaProfileMigrator::CopyPreferences(PRBool aReplace)
|
||||||
transform->prefHasValue = PR_TRUE;
|
transform->prefHasValue = PR_TRUE;
|
||||||
transform->prefSetterFunc(transform, branch);
|
transform->prefSetterFunc(transform, branch);
|
||||||
if (transform->type == _OPM(STRING) && transform->stringValue) {
|
if (transform->type == _OPM(STRING) && transform->stringValue) {
|
||||||
nsCRT::free(transform->stringValue);
|
NS_Free(transform->stringValue);
|
||||||
transform->stringValue = nsnull;
|
transform->stringValue = nsnull;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -550,7 +550,7 @@ nsOperaProfileMigrator::GetInteger(nsINIParser &aParser,
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
*aResult = val.ToInteger((PRInt32*) &rv);
|
*aResult = val.ToInteger(&rv);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -874,7 +874,7 @@ nsOperaCookieMigrator::AddCookieOverride(nsIPermissionManager* aManager)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
nsXPIDLCString domain;
|
nsCString domain;
|
||||||
SynthesizeDomain(getter_Copies(domain));
|
SynthesizeDomain(getter_Copies(domain));
|
||||||
nsCOMPtr<nsIURI> uri(do_CreateInstance("@mozilla.org/network/standard-url;1"));
|
nsCOMPtr<nsIURI> uri(do_CreateInstance("@mozilla.org/network/standard-url;1"));
|
||||||
if (!uri)
|
if (!uri)
|
||||||
|
@ -896,10 +896,10 @@ nsOperaCookieMigrator::AddCookie(nsICookieManager2* aManager)
|
||||||
{
|
{
|
||||||
// This is where we use the information gathered in all the other
|
// This is where we use the information gathered in all the other
|
||||||
// states to add a cookie to the Firebird/Firefox Cookie Manager.
|
// states to add a cookie to the Firebird/Firefox Cookie Manager.
|
||||||
nsXPIDLCString domain;
|
nsCString domain;
|
||||||
SynthesizeDomain(getter_Copies(domain));
|
SynthesizeDomain(getter_Copies(domain));
|
||||||
|
|
||||||
nsXPIDLCString path;
|
nsCString path;
|
||||||
SynthesizePath(getter_Copies(path));
|
SynthesizePath(getter_Copies(path));
|
||||||
|
|
||||||
mCookieOpen = PR_FALSE;
|
mCookieOpen = PR_FALSE;
|
||||||
|
@ -1006,7 +1006,7 @@ nsOperaProfileMigrator::CopyHistory(PRBool aReplace)
|
||||||
break;
|
break;
|
||||||
case LASTVISIT:
|
case LASTVISIT:
|
||||||
// Opera time format is a second offset, PRTime is a microsecond offset
|
// Opera time format is a second offset, PRTime is a microsecond offset
|
||||||
PRInt32 err;
|
nsresult err;
|
||||||
lastVisitDate = buffer.ToInteger(&err);
|
lastVisitDate = buffer.ToInteger(&err);
|
||||||
|
|
||||||
PRInt64 temp, million;
|
PRInt64 temp, million;
|
||||||
|
@ -1067,12 +1067,12 @@ nsOperaProfileMigrator::CopyBookmarks(PRBool aReplace)
|
||||||
nsCOMPtr<nsIStringBundle> bundle;
|
nsCOMPtr<nsIStringBundle> bundle;
|
||||||
bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
||||||
if (!aReplace) {
|
if (!aReplace) {
|
||||||
nsXPIDLString sourceNameOpera;
|
nsString sourceNameOpera;
|
||||||
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameOpera").get(),
|
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameOpera").get(),
|
||||||
getter_Copies(sourceNameOpera));
|
getter_Copies(sourceNameOpera));
|
||||||
|
|
||||||
const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
|
const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
|
||||||
nsXPIDLString importedOperaHotlistTitle;
|
nsString importedOperaHotlistTitle;
|
||||||
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
||||||
sourceNameStrings, 1,
|
sourceNameStrings, 1,
|
||||||
getter_Copies(importedOperaHotlistTitle));
|
getter_Copies(importedOperaHotlistTitle));
|
||||||
|
@ -1135,12 +1135,12 @@ nsOperaProfileMigrator::CopySmartKeywords(nsIBookmarksService* aBMS,
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
nsXPIDLString sourceNameOpera;
|
nsString sourceNameOpera;
|
||||||
aBundle->GetStringFromName(NS_LITERAL_STRING("sourceNameOpera").get(),
|
aBundle->GetStringFromName(NS_LITERAL_STRING("sourceNameOpera").get(),
|
||||||
getter_Copies(sourceNameOpera));
|
getter_Copies(sourceNameOpera));
|
||||||
|
|
||||||
const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
|
const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
|
||||||
nsXPIDLString importedSearchUrlsTitle;
|
nsString importedSearchUrlsTitle;
|
||||||
aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchURLsFolder").get(),
|
aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchURLsFolder").get(),
|
||||||
sourceNameStrings, 1,
|
sourceNameStrings, 1,
|
||||||
getter_Copies(importedSearchUrlsTitle));
|
getter_Copies(importedSearchUrlsTitle));
|
||||||
|
@ -1207,10 +1207,10 @@ nsOperaProfileMigrator::CopySmartKeywords(nsIBookmarksService* aBMS,
|
||||||
|
|
||||||
nsCAutoString hostCStr;
|
nsCAutoString hostCStr;
|
||||||
uri->GetHost(hostCStr);
|
uri->GetHost(hostCStr);
|
||||||
nsAutoString host; host.AssignWithConversion(hostCStr.get());
|
NS_ConvertASCIItoUTF16 host(hostCStr);
|
||||||
|
|
||||||
const PRUnichar* descStrings[] = { NS_ConvertUTF8toUTF16(keyword).get(), host.get() };
|
const PRUnichar* descStrings[] = { NS_ConvertUTF8toUTF16(keyword).get(), host.get() };
|
||||||
nsXPIDLString keywordDesc;
|
nsString keywordDesc;
|
||||||
aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchUrlDesc").get(),
|
aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchUrlDesc").get(),
|
||||||
descStrings, 2, getter_Copies(keywordDesc));
|
descStrings, 2, getter_Copies(keywordDesc));
|
||||||
|
|
||||||
|
@ -1340,7 +1340,6 @@ nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream,
|
||||||
nsAutoString name, keyword, description;
|
nsAutoString name, keyword, description;
|
||||||
nsCAutoString url;
|
nsCAutoString url;
|
||||||
PRBool onToolbar = PR_FALSE;
|
PRBool onToolbar = PR_FALSE;
|
||||||
NS_NAMED_LITERAL_STRING(empty, "");
|
|
||||||
do {
|
do {
|
||||||
nsCAutoString cBuffer;
|
nsCAutoString cBuffer;
|
||||||
rv = aStream->ReadLine(cBuffer, &moreData);
|
rv = aStream->ReadLine(cBuffer, &moreData);
|
||||||
|
@ -1349,7 +1348,7 @@ nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream,
|
||||||
if (!moreData) break;
|
if (!moreData) break;
|
||||||
|
|
||||||
CopyUTF8toUTF16(cBuffer, buffer);
|
CopyUTF8toUTF16(cBuffer, buffer);
|
||||||
nsXPIDLString data;
|
nsString data;
|
||||||
LineType type = GetLineType(buffer, getter_Copies(data));
|
LineType type = GetLineType(buffer, getter_Copies(data));
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case LineType_FOLDER:
|
case LineType_FOLDER:
|
||||||
|
@ -1415,10 +1414,10 @@ nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream,
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
name = empty;
|
name.Truncate();
|
||||||
url.AssignWithConversion(empty);
|
url.Truncate();
|
||||||
keyword = empty;
|
keyword.Truncate();
|
||||||
description = empty;
|
description.Truncate();
|
||||||
onToolbar = PR_FALSE;
|
onToolbar = PR_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1440,7 +1439,7 @@ nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream,
|
||||||
continue;
|
continue;
|
||||||
rv = ParseBookmarksFolder(aStream, itemRes, aToolbar, aBMS);
|
rv = ParseBookmarksFolder(aStream, itemRes, aToolbar, aBMS);
|
||||||
#endif
|
#endif
|
||||||
name = empty;
|
name.Truncate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "nsIBrowserProfileMigrator.h"
|
#include "nsIBrowserProfileMigrator.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
#include "nsVoidArray.h"
|
#include "nsVoidArray.h"
|
||||||
|
|
||||||
class nsICookieManager2;
|
class nsICookieManager2;
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include "nsBrowserProfileMigratorUtils.h"
|
#include "nsBrowserProfileMigratorUtils.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsIPrefService.h"
|
#include "nsIPrefService.h"
|
||||||
|
@ -173,11 +172,11 @@ nsPhoenixProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
|
||||||
aReplace, mSourceProfile, aResult);
|
aReplace, mSourceProfile, aResult);
|
||||||
|
|
||||||
// Now locate passwords
|
// Now locate passwords
|
||||||
nsXPIDLCString signonsFileName;
|
nsCString signonsFileName;
|
||||||
GetSignonFileName(aReplace, getter_Copies(signonsFileName));
|
GetSignonFileName(aReplace, getter_Copies(signonsFileName));
|
||||||
|
|
||||||
if (!signonsFileName.IsEmpty()) {
|
if (!signonsFileName.IsEmpty()) {
|
||||||
nsAutoString fileName; fileName.AssignWithConversion(signonsFileName);
|
NS_ConvertASCIItoUTF16 fileName(signonsFileName);
|
||||||
nsCOMPtr<nsIFile> sourcePasswordsFile;
|
nsCOMPtr<nsIFile> sourcePasswordsFile;
|
||||||
mSourceProfile->Clone(getter_AddRefs(sourcePasswordsFile));
|
mSourceProfile->Clone(getter_AddRefs(sourcePasswordsFile));
|
||||||
sourcePasswordsFile->Append(fileName);
|
sourcePasswordsFile->Append(fileName);
|
||||||
|
@ -229,11 +228,9 @@ NS_IMETHODIMP
|
||||||
nsPhoenixProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
nsPhoenixProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||||
{
|
{
|
||||||
if (!mProfileNames && !mProfileLocations) {
|
if (!mProfileNames && !mProfileLocations) {
|
||||||
nsresult rv = NS_NewISupportsArray(getter_AddRefs(mProfileNames));
|
mProfileNames = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
|
||||||
if (NS_FAILED(rv)) return rv;
|
mProfileLocations = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
|
||||||
|
NS_ENSURE_TRUE(mProfileNames && mProfileLocations, NS_ERROR_UNEXPECTED);
|
||||||
rv = NS_NewISupportsArray(getter_AddRefs(mProfileLocations));
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
|
|
||||||
// Fills mProfileNames and mProfileLocations
|
// Fills mProfileNames and mProfileLocations
|
||||||
FillProfileDataFromPhoenixRegistry();
|
FillProfileDataFromPhoenixRegistry();
|
||||||
|
@ -257,11 +254,14 @@ nsPhoenixProfileMigrator::GetSourceProfile(const PRUnichar* aProfile)
|
||||||
PRUint32 count;
|
PRUint32 count;
|
||||||
mProfileNames->Count(&count);
|
mProfileNames->Count(&count);
|
||||||
for (PRUint32 i = 0; i < count; ++i) {
|
for (PRUint32 i = 0; i < count; ++i) {
|
||||||
nsCOMPtr<nsISupportsString> str(do_QueryElementAt(mProfileNames, i));
|
nsCOMPtr<nsISupportsString> str;
|
||||||
nsXPIDLString profileName;
|
mProfileNames->QueryElementAt(i, NS_GET_IID(nsISupportsString),
|
||||||
|
getter_AddRefs(str));
|
||||||
|
nsString profileName;
|
||||||
str->GetData(profileName);
|
str->GetData(profileName);
|
||||||
if (profileName.Equals(aProfile)) {
|
if (profileName.Equals(aProfile)) {
|
||||||
mSourceProfile = do_QueryElementAt(mProfileLocations, i);
|
mProfileLocations->QueryElementAt(i, NS_GET_IID(nsILocalFile),
|
||||||
|
getter_AddRefs(mSourceProfile));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,7 +397,7 @@ nsPhoenixProfileMigrator::CopyPasswords(PRBool aReplace)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
nsXPIDLCString signonsFileName;
|
nsCString signonsFileName;
|
||||||
if (!aReplace)
|
if (!aReplace)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
@ -417,7 +417,7 @@ nsPhoenixProfileMigrator::CopyPasswords(PRBool aReplace)
|
||||||
if (signonsFileName.IsEmpty())
|
if (signonsFileName.IsEmpty())
|
||||||
return NS_ERROR_FILE_NOT_FOUND;
|
return NS_ERROR_FILE_NOT_FOUND;
|
||||||
|
|
||||||
nsAutoString fileName; fileName.AssignWithConversion(signonsFileName);
|
NS_ConvertASCIItoUTF16 fileName(signonsFileName);
|
||||||
return aReplace ? CopyFile(fileName, fileName) : NS_OK;
|
return aReplace ? CopyFile(fileName, fileName) : NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsNetscapeProfileMigratorBase.h"
|
#include "nsNetscapeProfileMigratorBase.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsIFile;
|
class nsIFile;
|
||||||
class nsIPrefBranch;
|
class nsIPrefBranch;
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "nsIDOMWindowInternal.h"
|
#include "nsIDOMWindowInternal.h"
|
||||||
#include "nsILocalFile.h"
|
#include "nsILocalFile.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
|
#include "nsIProperties.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
|
@ -51,13 +52,13 @@
|
||||||
|
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsBrowserCompsCID.h"
|
#include "nsBrowserCompsCID.h"
|
||||||
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "NSReg.h"
|
#include "NSReg.h"
|
||||||
#include "nsReadableUtils.h"
|
#include "nsStringAPI.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsString.h"
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "nsIWindowsRegKey.h"
|
#include "nsIWindowsRegKey.h"
|
||||||
|
@ -65,7 +66,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
#include "nsNativeCharsetUtils.h"
|
|
||||||
|
|
||||||
#ifndef MAXPATHLEN
|
#ifndef MAXPATHLEN
|
||||||
#ifdef _MAX_PATH
|
#ifdef _MAX_PATH
|
||||||
|
@ -95,8 +95,8 @@ nsProfileMigrator::Migrate(nsIProfileStartup* aStartup)
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
if (!bpm) {
|
if (!bpm) {
|
||||||
nsCAutoString contractID =
|
nsCAutoString contractID(NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX);
|
||||||
NS_LITERAL_CSTRING(NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX) + key;
|
contractID.Append(key);
|
||||||
|
|
||||||
bpm = do_CreateInstance(contractID.get());
|
bpm = do_CreateInstance(contractID.get());
|
||||||
if (!bpm) return NS_ERROR_FAILURE;
|
if (!bpm) return NS_ERROR_FAILURE;
|
||||||
|
@ -123,8 +123,8 @@ nsProfileMigrator::Migrate(nsIProfileStartup* aStartup)
|
||||||
// By opening the Migration FE with a supplied bpm, it will automatically
|
// By opening the Migration FE with a supplied bpm, it will automatically
|
||||||
// migrate from it.
|
// migrate from it.
|
||||||
nsCOMPtr<nsIWindowWatcher> ww(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
|
nsCOMPtr<nsIWindowWatcher> ww(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
|
||||||
nsCOMPtr<nsISupportsArray> params;
|
nsCOMPtr<nsISupportsArray> params =
|
||||||
NS_NewISupportsArray(getter_AddRefs(params));
|
do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
|
||||||
if (!ww || !params) return NS_ERROR_FAILURE;
|
if (!ww || !params) return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
params->AppendElement(cstr);
|
params->AppendElement(cstr);
|
||||||
|
@ -187,20 +187,18 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
|
||||||
if (NS_FAILED(regKey->ReadStringValue(EmptyString(), value)))
|
if (NS_FAILED(regKey->ReadStringValue(EmptyString(), value)))
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsAString::const_iterator start, end;
|
PRInt32 len = value.Find(NS_LITERAL_STRING(".exe"), CaseInsensitiveCompare);
|
||||||
value.BeginReading(start);
|
if (len == -1)
|
||||||
value.EndReading(end);
|
|
||||||
nsAString::const_iterator tmp = start;
|
|
||||||
|
|
||||||
if (!FindInReadable(NS_LITERAL_STRING(".exe"), tmp, end,
|
|
||||||
nsCaseInsensitiveStringComparator()))
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
PRUint32 start = 0;
|
||||||
// skip an opening quotation mark if present
|
// skip an opening quotation mark if present
|
||||||
if (value.CharAt(1) != ':')
|
if (value.get()[1] != ':') {
|
||||||
++start;
|
start = 1;
|
||||||
|
--len;
|
||||||
|
}
|
||||||
|
|
||||||
nsDependentSubstring filePath(start, end);
|
const nsDependentSubstring filePath(Substring(value, start, len));
|
||||||
|
|
||||||
// We want to find out what the default browser is but the path in and of itself
|
// We want to find out what the default browser is but the path in and of itself
|
||||||
// isn't enough. Why? Because sometimes on Windows paths get truncated like so:
|
// isn't enough. Why? Because sometimes on Windows paths get truncated like so:
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
|
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsBrowserProfileMigratorUtils.h"
|
#include "nsBrowserProfileMigratorUtils.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
|
#include "nsDirectoryServiceUtils.h"
|
||||||
#include "nsDocShellCID.h"
|
#include "nsDocShellCID.h"
|
||||||
#ifdef MOZ_PLACES
|
#ifdef MOZ_PLACES
|
||||||
#include "nsINavBookmarksService.h"
|
#include "nsINavBookmarksService.h"
|
||||||
|
@ -301,7 +301,7 @@ GetNullTerminatedString(CFStringRef aStringRef)
|
||||||
void
|
void
|
||||||
FreeNullTerminatedString(char* aString)
|
FreeNullTerminatedString(char* aString)
|
||||||
{
|
{
|
||||||
nsCRT::free(aString);
|
free(aString);
|
||||||
aString = nsnull;
|
aString = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,7 +476,7 @@ nsSafariProfileMigrator::SetDefaultEncoding(void* aTransform, nsIPrefBranch* aBr
|
||||||
for (PRUint16 i = 0; (charsetIndex == -1) &&
|
for (PRUint16 i = 0; (charsetIndex == -1) &&
|
||||||
i < (sizeof(gCharsets) / sizeof(gCharsets[0])); ++i) {
|
i < (sizeof(gCharsets) / sizeof(gCharsets[0])); ++i) {
|
||||||
if (gCharsets[i].webkitLabelLength == encodingLength &&
|
if (gCharsets[i].webkitLabelLength == encodingLength &&
|
||||||
!nsCRT::strcmp(gCharsets[i].webkitLabel, encodingStr))
|
!strcmp(gCharsets[i].webkitLabel, encodingStr))
|
||||||
charsetIndex = (PRInt16)i;
|
charsetIndex = (PRInt16)i;
|
||||||
}
|
}
|
||||||
if (charsetIndex == -1) // Default to "Western"
|
if (charsetIndex == -1) // Default to "Western"
|
||||||
|
@ -654,7 +654,7 @@ nsSafariProfileMigrator::SetDisplayImages(void* aTransform, nsIPrefBranch* aBran
|
||||||
nsresult
|
nsresult
|
||||||
nsSafariProfileMigrator::SetFontName(void* aTransform, nsIPrefBranch* aBranch)
|
nsSafariProfileMigrator::SetFontName(void* aTransform, nsIPrefBranch* aBranch)
|
||||||
{
|
{
|
||||||
nsXPIDLCString associatedLangGroup;
|
nsCString associatedLangGroup;
|
||||||
nsresult rv = aBranch->GetCharPref("migration.associatedLangGroup",
|
nsresult rv = aBranch->GetCharPref("migration.associatedLangGroup",
|
||||||
getter_Copies(associatedLangGroup));
|
getter_Copies(associatedLangGroup));
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
|
@ -670,7 +670,7 @@ nsSafariProfileMigrator::SetFontName(void* aTransform, nsIPrefBranch* aBranch)
|
||||||
nsresult
|
nsresult
|
||||||
nsSafariProfileMigrator::SetFontSize(void* aTransform, nsIPrefBranch* aBranch)
|
nsSafariProfileMigrator::SetFontSize(void* aTransform, nsIPrefBranch* aBranch)
|
||||||
{
|
{
|
||||||
nsXPIDLCString associatedLangGroup;
|
nsCString associatedLangGroup;
|
||||||
nsresult rv = aBranch->GetCharPref("migration.associatedLangGroup",
|
nsresult rv = aBranch->GetCharPref("migration.associatedLangGroup",
|
||||||
getter_Copies(associatedLangGroup));
|
getter_Copies(associatedLangGroup));
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
|
@ -916,12 +916,12 @@ nsSafariProfileMigrator::CopyBookmarks(PRBool aReplace)
|
||||||
nsCOMPtr<nsIStringBundle> bundle;
|
nsCOMPtr<nsIStringBundle> bundle;
|
||||||
bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
|
||||||
|
|
||||||
nsXPIDLString sourceNameSafari;
|
nsString sourceNameSafari;
|
||||||
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameSafari").get(),
|
bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameSafari").get(),
|
||||||
getter_Copies(sourceNameSafari));
|
getter_Copies(sourceNameSafari));
|
||||||
|
|
||||||
const PRUnichar* sourceNameStrings[] = { sourceNameSafari.get() };
|
const PRUnichar* sourceNameStrings[] = { sourceNameSafari.get() };
|
||||||
nsXPIDLString importedSafariBookmarksTitle;
|
nsString importedSafariBookmarksTitle;
|
||||||
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
|
||||||
sourceNameStrings, 1,
|
sourceNameStrings, 1,
|
||||||
getter_Copies(importedSafariBookmarksTitle));
|
getter_Copies(importedSafariBookmarksTitle));
|
||||||
|
@ -1144,7 +1144,9 @@ nsSafariProfileMigrator::ProfileHasContentStyleSheet(PRBool *outExists)
|
||||||
rv = userChromeDir->GetNativePath(userChromeDirPath);
|
rv = userChromeDir->GetNativePath(userChromeDirPath);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCAutoString path = userChromeDirPath + NS_LITERAL_CSTRING("/userContent.css");
|
nsCAutoString path(userChromeDirPath);
|
||||||
|
path.Append("/userContent.css");
|
||||||
|
|
||||||
nsCOMPtr<nsILocalFile> file;
|
nsCOMPtr<nsILocalFile> file;
|
||||||
rv = NS_NewNativeLocalFile(path, PR_FALSE,
|
rv = NS_NewNativeLocalFile(path, PR_FALSE,
|
||||||
getter_AddRefs(file));
|
getter_AddRefs(file));
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include "nsIBrowserProfileMigrator.h"
|
#include "nsIBrowserProfileMigrator.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include "nsBrowserProfileMigratorUtils.h"
|
#include "nsBrowserProfileMigratorUtils.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
#include "nsICookieManager2.h"
|
#include "nsICookieManager2.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
|
@ -161,11 +160,11 @@ nsSeamonkeyProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
|
||||||
aReplace, mSourceProfile, aResult);
|
aReplace, mSourceProfile, aResult);
|
||||||
|
|
||||||
// Now locate passwords
|
// Now locate passwords
|
||||||
nsXPIDLCString signonsFileName;
|
nsCString signonsFileName;
|
||||||
GetSignonFileName(aReplace, getter_Copies(signonsFileName));
|
GetSignonFileName(aReplace, getter_Copies(signonsFileName));
|
||||||
|
|
||||||
if (!signonsFileName.IsEmpty()) {
|
if (!signonsFileName.IsEmpty()) {
|
||||||
nsAutoString fileName; fileName.AssignWithConversion(signonsFileName);
|
NS_ConvertASCIItoUTF16 fileName(signonsFileName);
|
||||||
nsCOMPtr<nsIFile> sourcePasswordsFile;
|
nsCOMPtr<nsIFile> sourcePasswordsFile;
|
||||||
mSourceProfile->Clone(getter_AddRefs(sourcePasswordsFile));
|
mSourceProfile->Clone(getter_AddRefs(sourcePasswordsFile));
|
||||||
sourcePasswordsFile->Append(fileName);
|
sourcePasswordsFile->Append(fileName);
|
||||||
|
@ -217,11 +216,9 @@ NS_IMETHODIMP
|
||||||
nsSeamonkeyProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
nsSeamonkeyProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||||
{
|
{
|
||||||
if (!mProfileNames && !mProfileLocations) {
|
if (!mProfileNames && !mProfileLocations) {
|
||||||
nsresult rv = NS_NewISupportsArray(getter_AddRefs(mProfileNames));
|
mProfileNames = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
|
||||||
if (NS_FAILED(rv)) return rv;
|
mProfileLocations = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
|
||||||
|
NS_ENSURE_TRUE(mProfileNames && mProfileLocations, NS_ERROR_UNEXPECTED);
|
||||||
rv = NS_NewISupportsArray(getter_AddRefs(mProfileLocations));
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
|
|
||||||
// Fills mProfileNames and mProfileLocations
|
// Fills mProfileNames and mProfileLocations
|
||||||
FillProfileDataFromSeamonkeyRegistry();
|
FillProfileDataFromSeamonkeyRegistry();
|
||||||
|
@ -255,7 +252,7 @@ nsSeamonkeyProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
|
||||||
NS_GET_IID(nsIPrefLocalizedString),
|
NS_GET_IID(nsIPrefLocalizedString),
|
||||||
getter_AddRefs(prefValue));
|
getter_AddRefs(prefValue));
|
||||||
if (NS_SUCCEEDED(rv) && prefValue) {
|
if (NS_SUCCEEDED(rv) && prefValue) {
|
||||||
nsXPIDLString data;
|
nsString data;
|
||||||
prefValue->ToString(getter_Copies(data));
|
prefValue->ToString(getter_Copies(data));
|
||||||
|
|
||||||
nsCAutoString val;
|
nsCAutoString val;
|
||||||
|
@ -280,11 +277,14 @@ nsSeamonkeyProfileMigrator::GetSourceProfile(const PRUnichar* aProfile)
|
||||||
PRUint32 count;
|
PRUint32 count;
|
||||||
mProfileNames->Count(&count);
|
mProfileNames->Count(&count);
|
||||||
for (PRUint32 i = 0; i < count; ++i) {
|
for (PRUint32 i = 0; i < count; ++i) {
|
||||||
nsCOMPtr<nsISupportsString> str(do_QueryElementAt(mProfileNames, i));
|
nsCOMPtr<nsISupportsString> str;
|
||||||
nsXPIDLString profileName;
|
mProfileNames->QueryElementAt(i, NS_GET_IID(nsISupportsString),
|
||||||
|
getter_AddRefs(str));
|
||||||
|
nsString profileName;
|
||||||
str->GetData(profileName);
|
str->GetData(profileName);
|
||||||
if (profileName.Equals(aProfile)) {
|
if (profileName.Equals(aProfile)) {
|
||||||
mSourceProfile = do_QueryElementAt(mProfileLocations, i);
|
mProfileLocations->QueryElementAt(i, NS_GET_IID(nsILocalFile),
|
||||||
|
getter_AddRefs(mSourceProfile));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -570,7 +570,7 @@ nsSeamonkeyProfileMigrator::WriteFontsBranch(nsIPrefService* aPrefService,
|
||||||
switch (pref->type) {
|
switch (pref->type) {
|
||||||
case nsIPrefBranch::PREF_STRING:
|
case nsIPrefBranch::PREF_STRING:
|
||||||
rv = branch->SetCharPref(pref->prefName, pref->stringValue);
|
rv = branch->SetCharPref(pref->prefName, pref->stringValue);
|
||||||
nsCRT::free(pref->stringValue);
|
NS_Free(pref->stringValue);
|
||||||
pref->stringValue = nsnull;
|
pref->stringValue = nsnull;
|
||||||
break;
|
break;
|
||||||
case nsIPrefBranch::PREF_BOOL:
|
case nsIPrefBranch::PREF_BOOL:
|
||||||
|
@ -585,11 +585,11 @@ nsSeamonkeyProfileMigrator::WriteFontsBranch(nsIPrefService* aPrefService,
|
||||||
rv = branch->SetComplexValue(pref->prefName,
|
rv = branch->SetComplexValue(pref->prefName,
|
||||||
NS_GET_IID(nsIPrefLocalizedString),
|
NS_GET_IID(nsIPrefLocalizedString),
|
||||||
pls);
|
pls);
|
||||||
nsCRT::free(pref->wstringValue);
|
NS_Free(pref->wstringValue);
|
||||||
pref->wstringValue = nsnull;
|
pref->wstringValue = nsnull;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nsCRT::free(pref->prefName);
|
NS_Free(pref->prefName);
|
||||||
pref->prefName = nsnull;
|
pref->prefName = nsnull;
|
||||||
delete pref;
|
delete pref;
|
||||||
pref = nsnull;
|
pref = nsnull;
|
||||||
|
@ -673,13 +673,13 @@ nsSeamonkeyProfileMigrator::CopyPasswords(PRBool aReplace)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
nsXPIDLCString signonsFileName;
|
nsCString signonsFileName;
|
||||||
GetSignonFileName(aReplace, getter_Copies(signonsFileName));
|
GetSignonFileName(aReplace, getter_Copies(signonsFileName));
|
||||||
|
|
||||||
if (signonsFileName.IsEmpty())
|
if (signonsFileName.IsEmpty())
|
||||||
return NS_ERROR_FILE_NOT_FOUND;
|
return NS_ERROR_FILE_NOT_FOUND;
|
||||||
|
|
||||||
nsAutoString fileName; fileName.AssignWithConversion(signonsFileName);
|
NS_ConvertASCIItoUTF16 fileName(signonsFileName);
|
||||||
if (aReplace)
|
if (aReplace)
|
||||||
rv = CopyFile(fileName, fileName);
|
rv = CopyFile(fileName, fileName);
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsNetscapeProfileMigratorBase.h"
|
#include "nsNetscapeProfileMigratorBase.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsIFile;
|
class nsIFile;
|
||||||
class nsIPrefBranch;
|
class nsIPrefBranch;
|
||||||
|
|
|
@ -43,7 +43,6 @@ include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
MODULE = safebrowsing
|
MODULE = safebrowsing
|
||||||
LIBRARY_NAME = safebrowsing_s
|
LIBRARY_NAME = safebrowsing_s
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
FORCE_STATIC_LIB = 1
|
FORCE_STATIC_LIB = 1
|
||||||
|
|
||||||
REQUIRES = \
|
REQUIRES = \
|
||||||
|
|
|
@ -42,8 +42,9 @@
|
||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
#include "nsIWebProgress.h"
|
#include "nsIWebProgress.h"
|
||||||
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS4(nsDocNavStartProgressListener,
|
NS_IMPL_ISUPPORTS4(nsDocNavStartProgressListener,
|
||||||
nsIDocNavStartProgressListener,
|
nsIDocNavStartProgressListener,
|
||||||
|
@ -328,7 +329,7 @@ nsDocNavStartProgressListener::Observe(nsISupports *subject, const char *topic,
|
||||||
// We don't care about URL fragments so we take that off.
|
// We don't care about URL fragments so we take that off.
|
||||||
PRInt32 pos = uriString.FindChar('#');
|
PRInt32 pos = uriString.FindChar('#');
|
||||||
if (pos > -1) {
|
if (pos > -1) {
|
||||||
uriString.Truncate(pos);
|
uriString.SetLength(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
mCallback->OnDocNavStart(request, uriString);
|
mCallback->OnDocNavStart(request, uriString);
|
||||||
|
|
|
@ -43,7 +43,6 @@ VPATH = @srcdir@
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
MODULE = shellservice
|
MODULE = shellservice
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
|
|
||||||
REQUIRES = \
|
REQUIRES = \
|
||||||
xpcom \
|
xpcom \
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
#include "nsIPrefService.h"
|
#include "nsIPrefService.h"
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
#include "nsIGConfService.h"
|
#include "nsIGConfService.h"
|
||||||
#include "nsIGnomeVFSService.h"
|
#include "nsIGnomeVFSService.h"
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
|
@ -56,10 +56,10 @@
|
||||||
#include "imgIRequest.h"
|
#include "imgIRequest.h"
|
||||||
#include "imgIContainer.h"
|
#include "imgIContainer.h"
|
||||||
#include "nsIImage.h"
|
#include "nsIImage.h"
|
||||||
|
#include "prprf.h"
|
||||||
#ifdef MOZ_WIDGET_GTK2
|
#ifdef MOZ_WIDGET_GTK2
|
||||||
#include "nsIImageToPixbuf.h"
|
#include "nsIImageToPixbuf.h"
|
||||||
#endif
|
#endif
|
||||||
#include "nsColor.h"
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
@ -217,12 +217,13 @@ nsGNOMEShellService::SetDefaultBrowser(PRBool aClaimAllTypes,
|
||||||
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
|
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
|
||||||
|
|
||||||
nsCAutoString schemeList;
|
nsCAutoString schemeList;
|
||||||
nsCAutoString appKeyValue(mAppPath + NS_LITERAL_CSTRING(" \"%s\""));
|
nsCAutoString appKeyValue(mAppPath);
|
||||||
|
appKeyValue.Append(" \"%s\"");
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
|
for (i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
|
||||||
schemeList.Append(nsDependentCString(appProtocols[i].name)
|
schemeList.Append(nsDependentCString(appProtocols[i].name));
|
||||||
+ NS_LITERAL_CSTRING(","));
|
schemeList.Append(',');
|
||||||
|
|
||||||
if (appProtocols[i].essential || aClaimAllTypes) {
|
if (appProtocols[i].essential || aClaimAllTypes) {
|
||||||
gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),
|
gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),
|
||||||
|
@ -242,7 +243,7 @@ nsGNOMEShellService::SetDefaultBrowser(PRBool aClaimAllTypes,
|
||||||
bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle));
|
bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle));
|
||||||
NS_ENSURE_TRUE(brandBundle, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(brandBundle, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsXPIDLString brandShortName, brandFullName;
|
nsString brandShortName, brandFullName;
|
||||||
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
|
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
|
||||||
getter_Copies(brandShortName));
|
getter_Copies(brandShortName));
|
||||||
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(),
|
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(),
|
||||||
|
@ -279,7 +280,7 @@ nsGNOMEShellService::SetDefaultBrowser(PRBool aClaimAllTypes,
|
||||||
if (lastSlash == -1) {
|
if (lastSlash == -1) {
|
||||||
NS_ERROR("no slash in executable path?");
|
NS_ERROR("no slash in executable path?");
|
||||||
} else {
|
} else {
|
||||||
iconFilePath.Truncate(lastSlash);
|
iconFilePath.SetLength(lastSlash);
|
||||||
nsCOMPtr<nsILocalFile> iconFile;
|
nsCOMPtr<nsILocalFile> iconFile;
|
||||||
NS_NewNativeLocalFile(iconFilePath, PR_FALSE, getter_AddRefs(iconFile));
|
NS_NewNativeLocalFile(iconFilePath, PR_FALSE, getter_AddRefs(iconFile));
|
||||||
if (iconFile) {
|
if (iconFile) {
|
||||||
|
@ -400,7 +401,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||||
nsCAutoString filePath(PR_GetEnv("HOME"));
|
nsCAutoString filePath(PR_GetEnv("HOME"));
|
||||||
|
|
||||||
// get the product brand name from localized strings
|
// get the product brand name from localized strings
|
||||||
nsXPIDLString brandName;
|
nsString brandName;
|
||||||
nsCID bundleCID = NS_STRINGBUNDLESERVICE_CID;
|
nsCID bundleCID = NS_STRINGBUNDLESERVICE_CID;
|
||||||
nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(bundleCID));
|
nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(bundleCID));
|
||||||
if (bundleService) {
|
if (bundleService) {
|
||||||
|
@ -415,10 +416,10 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the file name
|
// build the file name
|
||||||
filePath.Append(NS_LITERAL_CSTRING("/") +
|
filePath.Append('/');
|
||||||
NS_ConvertUTF16toUTF8(brandName) +
|
filePath.Append(NS_ConvertUTF16toUTF8(brandName));
|
||||||
NS_LITERAL_CSTRING("_wallpaper.png"));
|
filePath.Append("_wallpaper.png");
|
||||||
|
|
||||||
// write the image to a file in the home dir
|
// write the image to a file in the home dir
|
||||||
rv = WriteImage(filePath, gfxFrame);
|
rv = WriteImage(filePath, gfxFrame);
|
||||||
|
|
||||||
|
@ -447,6 +448,59 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In: pointer to two characters CC
|
||||||
|
// Out: parsed color number
|
||||||
|
static PRUint8
|
||||||
|
HexToNum(char ch)
|
||||||
|
{
|
||||||
|
if ('0' <= ch && '9' >= ch)
|
||||||
|
return ch - '0';
|
||||||
|
|
||||||
|
if ('A' <= ch && 'F' >= ch)
|
||||||
|
return ch - 'A';
|
||||||
|
|
||||||
|
if ('a' <= ch && 'f' >= ch)
|
||||||
|
return ch - 'a';
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// In: 3 or 6-character RRGGBB hex string
|
||||||
|
// Out: component colors
|
||||||
|
static PRBool
|
||||||
|
HexToRGB(const nsCString& aColorSpec,
|
||||||
|
PRUint8 &aRed,
|
||||||
|
PRUint8 &aGreen,
|
||||||
|
PRUint8 &aBlue)
|
||||||
|
{
|
||||||
|
const char *buf = aColorSpec.get();
|
||||||
|
|
||||||
|
if (aColorSpec.Length() == 6) {
|
||||||
|
aRed = HexToNum(buf[0]) >> 4 |
|
||||||
|
HexToNum(buf[1]);
|
||||||
|
aGreen = HexToNum(buf[2]) >> 4 |
|
||||||
|
HexToNum(buf[3]);
|
||||||
|
aBlue = HexToNum(buf[4]) >> 4 |
|
||||||
|
HexToNum(buf[5]);
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aColorSpec.Length() == 3) {
|
||||||
|
aRed = HexToNum(buf[0]);
|
||||||
|
aGreen = HexToNum(buf[1]);
|
||||||
|
aBlue = HexToNum(buf[2]);
|
||||||
|
|
||||||
|
aRed |= aRed >> 4;
|
||||||
|
aGreen |= aGreen >> 4;
|
||||||
|
aBlue |= aBlue >> 4;
|
||||||
|
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return PR_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsGNOMEShellService::GetDesktopBackgroundColor(PRUint32 *aColor)
|
nsGNOMEShellService::GetDesktopBackgroundColor(PRUint32 *aColor)
|
||||||
{
|
{
|
||||||
|
@ -463,26 +517,36 @@ nsGNOMEShellService::GetDesktopBackgroundColor(PRUint32 *aColor)
|
||||||
// Chop off the leading '#' character
|
// Chop off the leading '#' character
|
||||||
background.Cut(0, 1);
|
background.Cut(0, 1);
|
||||||
|
|
||||||
nscolor rgb;
|
PRUint8 red, green, blue;
|
||||||
if (!NS_ASCIIHexToRGB(background, &rgb))
|
if (!HexToRGB(background, red, green, blue))
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
// The result must be in RGB order with the high 8 bits zero.
|
// The result must be in RGB order with the high 8 bits zero.
|
||||||
*aColor = (NS_GET_R(rgb) << 16 | NS_GET_G(rgb) << 8 | NS_GET_B(rgb));
|
*aColor = (red << 16 | green << 8 | blue);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ColorToHex(PRUint32 aColor, nsCString& aResult)
|
||||||
|
{
|
||||||
|
char *buf = aResult.BeginWriting(7);
|
||||||
|
if (!buf)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PRUint8 red = (aColor >> 16);
|
||||||
|
PRUint8 green = (aColor >> 8) & 0xff;
|
||||||
|
PRUint8 blue = aColor & 0xff;
|
||||||
|
|
||||||
|
PR_snprintf(buf, 8, "#%02x%02x%02x", red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsGNOMEShellService::SetDesktopBackgroundColor(PRUint32 aColor)
|
nsGNOMEShellService::SetDesktopBackgroundColor(PRUint32 aColor)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
|
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
|
||||||
|
|
||||||
unsigned char red = (aColor >> 16);
|
nsCString colorString;
|
||||||
unsigned char green = (aColor >> 8) & 0xff;
|
ColorToHex(aColor, colorString);
|
||||||
unsigned char blue = aColor & 0xff;
|
|
||||||
|
|
||||||
nsCAutoString colorString;
|
|
||||||
NS_RGBToASCIIHex(NS_RGB(red, green, blue), colorString);
|
|
||||||
|
|
||||||
gconf->SetString(NS_LITERAL_CSTRING(kDesktopColorKey), colorString);
|
gconf->SetString(NS_LITERAL_CSTRING(kDesktopColorKey), colorString);
|
||||||
|
|
||||||
|
@ -556,7 +620,7 @@ nsGNOMEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const ns
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
const nsPromiseFlatCString& spec = PromiseFlatCString(aURI);
|
const nsCString spec(aURI);
|
||||||
const char* specStr = spec.get();
|
const char* specStr = spec.get();
|
||||||
PRUint32 pid;
|
PRUint32 pid;
|
||||||
return process->Run(PR_FALSE, &specStr, 1, &pid);
|
return process->Run(PR_FALSE, &specStr, 1, &pid);
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#define nsgnomeshellservice_h____
|
#define nsgnomeshellservice_h____
|
||||||
|
|
||||||
#include "nsIShellService.h"
|
#include "nsIShellService.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
class nsGNOMEShellService : public nsIShellService
|
class nsGNOMEShellService : public nsIShellService
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Ben Goodger <ben@mozilla.org> (Original Author)
|
* Ben Goodger <ben@mozilla.org> (Original Author)
|
||||||
* Asaf Romano <mozilla.mano@sent.com>
|
* Asaf Romano <mozilla.mano@sent.com>
|
||||||
|
* Benjamin Smedberg <benjamin@smedbergs.us>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
@ -52,7 +53,7 @@
|
||||||
#include "nsMacShellService.h"
|
#include "nsMacShellService.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsShellService.h"
|
#include "nsShellService.h"
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
|
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
|
@ -468,7 +469,7 @@ nsMacShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsAC
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
const nsPromiseFlatCString& spec = PromiseFlatCString(aURI);
|
const nsCString spec(aURI);
|
||||||
const UInt8* uriString = (const UInt8*)spec.get();
|
const UInt8* uriString = (const UInt8*)spec.get();
|
||||||
CFURLRef uri = ::CFURLCreateWithBytes(NULL, uriString, aURI.Length(),
|
CFURLRef uri = ::CFURLCreateWithBytes(NULL, uriString, aURI.Length(),
|
||||||
kCFStringEncodingUTF8, NULL);
|
kCFStringEncodingUTF8, NULL);
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "nsIMacShellService.h"
|
#include "nsIMacShellService.h"
|
||||||
#include "nsIWebProgressListener.h"
|
#include "nsIWebProgressListener.h"
|
||||||
#include "nsILocalFile.h"
|
#include "nsILocalFile.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
class nsMacShellService : public nsIMacShellService,
|
class nsMacShellService : public nsIMacShellService,
|
||||||
public nsIWebProgressListener
|
public nsIWebProgressListener
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include "gfxIImageFrame.h"
|
#include "gfxIImageFrame.h"
|
||||||
#include "imgIContainer.h"
|
#include "imgIContainer.h"
|
||||||
#include "imgIRequest.h"
|
#include "imgIRequest.h"
|
||||||
#include "nsCRT.h"
|
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
#include "nsIDOMElement.h"
|
#include "nsIDOMElement.h"
|
||||||
#include "nsIDOMHTMLImageElement.h"
|
#include "nsIDOMHTMLImageElement.h"
|
||||||
|
@ -57,7 +56,6 @@
|
||||||
#include "nsIProcess.h"
|
#include "nsIProcess.h"
|
||||||
#include "nsICategoryManager.h"
|
#include "nsICategoryManager.h"
|
||||||
#include "nsBrowserCompsCID.h"
|
#include "nsBrowserCompsCID.h"
|
||||||
#include "nsNativeCharsetUtils.h"
|
|
||||||
#include "nsDirectoryServiceUtils.h"
|
#include "nsDirectoryServiceUtils.h"
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
|
|
||||||
|
@ -452,12 +450,13 @@ nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUs
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// Create the Start Menu item if it doesn't exist
|
// Create the Start Menu item if it doesn't exist
|
||||||
nsXPIDLString brandFullName;
|
nsString brandFullName;
|
||||||
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(),
|
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(),
|
||||||
getter_Copies(brandFullName));
|
getter_Copies(brandFullName));
|
||||||
nsCAutoString nativeFullName;
|
nsCAutoString nativeFullName;
|
||||||
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
||||||
NS_CopyUnicodeToNative(brandFullName, nativeFullName);
|
NS_UTF16ToCString(brandFullName, NS_CSTRING_ENCODING_NATIVE_FILESYSTEM,
|
||||||
|
nativeFullName);
|
||||||
|
|
||||||
nsCAutoString key1(NS_LITERAL_CSTRING(SMI));
|
nsCAutoString key1(NS_LITERAL_CSTRING(SMI));
|
||||||
key1.Append(exeName);
|
key1.Append(exeName);
|
||||||
|
@ -466,35 +465,39 @@ nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUs
|
||||||
backupKey, aClaimAllTypes, aForAllUsers);
|
backupKey, aClaimAllTypes, aForAllUsers);
|
||||||
|
|
||||||
// Set the Options and Safe Mode start menu context menu item labels
|
// Set the Options and Safe Mode start menu context menu item labels
|
||||||
nsCAutoString optionsKey(NS_LITERAL_CSTRING(SMI "%APPEXE%\\shell\\properties"));
|
nsCAutoString optionsKey(SMI);
|
||||||
optionsKey.ReplaceSubstring("%APPEXE%", exeName.get());
|
optionsKey.Append(exeName);
|
||||||
|
optionsKey.Append("\\shell\\properties");
|
||||||
|
|
||||||
nsCAutoString safeModeKey(NS_LITERAL_CSTRING(SMI "%APPEXE%\\shell\\safemode"));
|
nsCAutoString safeModeKey(SMI);
|
||||||
safeModeKey.ReplaceSubstring("%APPEXE%", exeName.get());
|
safeModeKey.Append(exeName);
|
||||||
|
safeModeKey.Append("\\shell\\safemode");
|
||||||
|
|
||||||
nsXPIDLString brandShortName;
|
nsString brandShortName;
|
||||||
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
|
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
|
||||||
getter_Copies(brandShortName));
|
getter_Copies(brandShortName));
|
||||||
|
|
||||||
const PRUnichar* brandNameStrings[] = { brandShortName.get() };
|
const PRUnichar* brandNameStrings[] = { brandShortName.get() };
|
||||||
|
|
||||||
// Set the Options menu item
|
// Set the Options menu item
|
||||||
nsXPIDLString optionsTitle;
|
nsString optionsTitle;
|
||||||
bundle->FormatStringFromName(NS_LITERAL_STRING("optionsLabel").get(),
|
bundle->FormatStringFromName(NS_LITERAL_STRING("optionsLabel").get(),
|
||||||
brandNameStrings, 1, getter_Copies(optionsTitle));
|
brandNameStrings, 1, getter_Copies(optionsTitle));
|
||||||
// Set the Safe Mode menu item
|
// Set the Safe Mode menu item
|
||||||
nsXPIDLString safeModeTitle;
|
nsString safeModeTitle;
|
||||||
bundle->FormatStringFromName(NS_LITERAL_STRING("safeModeLabel").get(),
|
bundle->FormatStringFromName(NS_LITERAL_STRING("safeModeLabel").get(),
|
||||||
brandNameStrings, 1, getter_Copies(safeModeTitle));
|
brandNameStrings, 1, getter_Copies(safeModeTitle));
|
||||||
|
|
||||||
// Set the registry keys
|
// Set the registry keys
|
||||||
nsCAutoString nativeTitle;
|
nsCAutoString nativeTitle;
|
||||||
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
||||||
NS_CopyUnicodeToNative(optionsTitle, nativeTitle);
|
NS_UTF16ToCString(optionsTitle, NS_CSTRING_ENCODING_NATIVE_FILESYSTEM,
|
||||||
|
nativeTitle);
|
||||||
SetRegKey(optionsKey.get(), "", nativeTitle.get(), PR_TRUE, backupKey,
|
SetRegKey(optionsKey.get(), "", nativeTitle.get(), PR_TRUE, backupKey,
|
||||||
aClaimAllTypes, aForAllUsers);
|
aClaimAllTypes, aForAllUsers);
|
||||||
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
||||||
NS_CopyUnicodeToNative(safeModeTitle, nativeTitle);
|
NS_UTF16ToCString(safeModeTitle, NS_CSTRING_ENCODING_NATIVE_FILESYSTEM,
|
||||||
|
nativeTitle);
|
||||||
SetRegKey(safeModeKey.get(), "", nativeTitle.get(), PR_TRUE, backupKey,
|
SetRegKey(safeModeKey.get(), "", nativeTitle.get(), PR_TRUE, backupKey,
|
||||||
aClaimAllTypes, aForAllUsers);
|
aClaimAllTypes, aForAllUsers);
|
||||||
|
|
||||||
|
@ -571,7 +574,7 @@ nsWindowsShellService::DeleteRegKey(HKEY baseKey, const char *keyName)
|
||||||
|
|
||||||
// Continue till we get an error or are done.
|
// Continue till we get an error or are done.
|
||||||
while (rc == ERROR_SUCCESS) {
|
while (rc == ERROR_SUCCESS) {
|
||||||
char subkeyName[_MAX_PATH];
|
char subkeyName[MAX_PATH];
|
||||||
DWORD len = sizeof subkeyName;
|
DWORD len = sizeof subkeyName;
|
||||||
// Get first subkey name. Note that we always get the
|
// Get first subkey name. Note that we always get the
|
||||||
// first one, then delete it. So we need to get
|
// first one, then delete it. So we need to get
|
||||||
|
@ -791,7 +794,7 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// e.g. "Desktop Background.bmp"
|
// e.g. "Desktop Background.bmp"
|
||||||
nsXPIDLString fileLeafName;
|
nsString fileLeafName;
|
||||||
rv = shellBundle->GetStringFromName
|
rv = shellBundle->GetStringFromName
|
||||||
(NS_LITERAL_STRING("desktopBackgroundLeafNameWin").get(),
|
(NS_LITERAL_STRING("desktopBackgroundLeafNameWin").get(),
|
||||||
getter_Copies(fileLeafName));
|
getter_Copies(fileLeafName));
|
||||||
|
@ -1057,7 +1060,7 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsWindowsShellService::Observe(nsISupports* aObject, const char* aTopic, const PRUnichar* aMessage)
|
nsWindowsShellService::Observe(nsISupports* aObject, const char* aTopic, const PRUnichar* aMessage)
|
||||||
{
|
{
|
||||||
if (!nsCRT::strcmp("app-startup", aTopic)) {
|
if (!strcmp("app-startup", aTopic)) {
|
||||||
PRBool isDefault;
|
PRBool isDefault;
|
||||||
IsDefaultBrowser(PR_FALSE, &isDefault);
|
IsDefaultBrowser(PR_FALSE, &isDefault);
|
||||||
if (!isDefault)
|
if (!isDefault)
|
||||||
|
@ -1065,7 +1068,7 @@ nsWindowsShellService::Observe(nsISupports* aObject, const char* aTopic, const P
|
||||||
|
|
||||||
return RegisterDDESupport();
|
return RegisterDDESupport();
|
||||||
}
|
}
|
||||||
else if (!nsCRT::strcmp("quit-application", aTopic)) {
|
else if (!strcmp("quit-application", aTopic)) {
|
||||||
PRBool isDefault;
|
PRBool isDefault;
|
||||||
IsDefaultBrowser(PR_FALSE, &isDefault);
|
IsDefaultBrowser(PR_FALSE, &isDefault);
|
||||||
if (!isDefault)
|
if (!isDefault)
|
||||||
|
@ -1093,7 +1096,7 @@ nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
const nsPromiseFlatCString& spec = PromiseFlatCString(aURI);
|
const nsCString spec(aURI);
|
||||||
const char* specStr = spec.get();
|
const char* specStr = spec.get();
|
||||||
PRUint32 pid;
|
PRUint32 pid;
|
||||||
return process->Run(PR_FALSE, &specStr, 1, &pid);
|
return process->Run(PR_FALSE, &specStr, 1, &pid);
|
||||||
|
|
|
@ -33,11 +33,9 @@ bin/libmozjs.so
|
||||||
bin/libplc4.so
|
bin/libplc4.so
|
||||||
bin/libplds4.so
|
bin/libplds4.so
|
||||||
bin/libxpcom.so
|
bin/libxpcom.so
|
||||||
bin/libxpcom_core.so
|
bin/libxul.so
|
||||||
bin/libxpistub.so
|
bin/libxpistub.so
|
||||||
bin/libnspr4.so
|
bin/libnspr4.so
|
||||||
bin/components/libxpinstall.so
|
|
||||||
bin/components/libjar50.so
|
|
||||||
|
|
||||||
[browser]
|
[browser]
|
||||||
; [Base Browser Files]
|
; [Base Browser Files]
|
||||||
|
@ -50,6 +48,8 @@ bin/res/cmessage.txt
|
||||||
bin/xpicleanup
|
bin/xpicleanup
|
||||||
|
|
||||||
; [Components]
|
; [Components]
|
||||||
|
bin/components/libappmeta.so
|
||||||
|
bin/components/libimgicon.so
|
||||||
bin/components/accessibility.xpt
|
bin/components/accessibility.xpt
|
||||||
bin/components/appshell.xpt
|
bin/components/appshell.xpt
|
||||||
bin/components/appstartup.xpt
|
bin/components/appstartup.xpt
|
||||||
|
@ -107,7 +107,6 @@ bin/components/imglib2.xpt
|
||||||
bin/components/intl.xpt
|
bin/components/intl.xpt
|
||||||
bin/components/jar.xpt
|
bin/components/jar.xpt
|
||||||
bin/components/jsconsole.xpt
|
bin/components/jsconsole.xpt
|
||||||
bin/components/libjsd.so
|
|
||||||
bin/components/jsdservice.xpt
|
bin/components/jsdservice.xpt
|
||||||
bin/components/layout_base.xpt
|
bin/components/layout_base.xpt
|
||||||
bin/components/layout_printing.xpt
|
bin/components/layout_printing.xpt
|
||||||
|
|
|
@ -32,11 +32,9 @@ bin\js3250.dll
|
||||||
bin\plc4.dll
|
bin\plc4.dll
|
||||||
bin\plds4.dll
|
bin\plds4.dll
|
||||||
bin\xpcom.dll
|
bin\xpcom.dll
|
||||||
bin\xpcom_core.dll
|
bin\xul.dll
|
||||||
bin\xpistub.dll
|
bin\xpistub.dll
|
||||||
bin\nspr4.dll
|
bin\nspr4.dll
|
||||||
bin\components\xpinstal.dll
|
|
||||||
bin\components\jar50.dll
|
|
||||||
bin\Microsoft.VC80.CRT.manifest
|
bin\Microsoft.VC80.CRT.manifest
|
||||||
bin\msvcm80.dll
|
bin\msvcm80.dll
|
||||||
bin\msvcp80.dll
|
bin\msvcp80.dll
|
||||||
|
@ -52,6 +50,7 @@ bin\LICENSE
|
||||||
bin\README.txt
|
bin\README.txt
|
||||||
|
|
||||||
; [Components]
|
; [Components]
|
||||||
|
bin\appmeta.dll
|
||||||
bin\components\alerts.xpt
|
bin\components\alerts.xpt
|
||||||
bin\AccessibleMarshal.dll
|
bin\AccessibleMarshal.dll
|
||||||
bin\components\accessibility.xpt
|
bin\components\accessibility.xpt
|
||||||
|
|
|
@ -157,6 +157,7 @@ MODULES_core := \
|
||||||
mozilla/modules/oji \
|
mozilla/modules/oji \
|
||||||
mozilla/modules/plugin \
|
mozilla/modules/plugin \
|
||||||
mozilla/modules/zlib \
|
mozilla/modules/zlib \
|
||||||
|
mozilla/modules/staticmod \
|
||||||
mozilla/netwerk \
|
mozilla/netwerk \
|
||||||
mozilla/plugin/oji \
|
mozilla/plugin/oji \
|
||||||
mozilla/profile \
|
mozilla/profile \
|
||||||
|
|
|
@ -116,6 +116,7 @@ MOZ_PLAINTEXT_EDITOR_ONLY = @MOZ_PLAINTEXT_EDITOR_ONLY@
|
||||||
MOZ_COMPOSER = @MOZ_COMPOSER@
|
MOZ_COMPOSER = @MOZ_COMPOSER@
|
||||||
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
|
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
|
||||||
MOZ_ENABLE_LIBXUL = @MOZ_ENABLE_LIBXUL@
|
MOZ_ENABLE_LIBXUL = @MOZ_ENABLE_LIBXUL@
|
||||||
|
MOZ_META_COMPONENT = @MOZ_META_COMPONENT@
|
||||||
ENABLE_TESTS = @ENABLE_TESTS@
|
ENABLE_TESTS = @ENABLE_TESTS@
|
||||||
IBMBIDI = @IBMBIDI@
|
IBMBIDI = @IBMBIDI@
|
||||||
MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
|
MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
|
||||||
|
|
|
@ -290,11 +290,18 @@ ifneq (,$(FORCE_SHARED_LIB)$(FORCE_USE_PIC))
|
||||||
_ENABLE_PIC=1
|
_ENABLE_PIC=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# In Firefox, all components are linked into either libxul or the static
|
||||||
|
# meta-component, and should be compiled with PIC.
|
||||||
|
ifdef MOZ_META_COMPONENT
|
||||||
|
_ENABLE_PIC=1
|
||||||
|
endif
|
||||||
|
|
||||||
# If module is going to be merged into the nsStaticModule,
|
# If module is going to be merged into the nsStaticModule,
|
||||||
# make sure that the entry points are translated and
|
# make sure that the entry points are translated and
|
||||||
# the module is built static.
|
# the module is built static.
|
||||||
|
|
||||||
ifdef IS_COMPONENT
|
ifdef IS_COMPONENT
|
||||||
|
ifdef EXPORT_LIBRARY
|
||||||
ifneq (,$(BUILD_STATIC_LIBS))
|
ifneq (,$(BUILD_STATIC_LIBS))
|
||||||
ifdef MODULE_NAME
|
ifdef MODULE_NAME
|
||||||
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
|
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
|
||||||
|
@ -302,6 +309,7 @@ FORCE_STATIC_LIB=1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Determine if module being compiled is destined
|
# Determine if module being compiled is destined
|
||||||
# to be merged into libxul
|
# to be merged into libxul
|
||||||
|
|
13
configure.in
13
configure.in
|
@ -3996,6 +3996,7 @@ MOZ_ARG_HEADER(Application)
|
||||||
|
|
||||||
BUILD_MODULES=all
|
BUILD_MODULES=all
|
||||||
BUILD_STATIC_LIBS=
|
BUILD_STATIC_LIBS=
|
||||||
|
MOZ_META_COMPONENT=
|
||||||
ENABLE_TESTS=1
|
ENABLE_TESTS=1
|
||||||
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
|
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
|
||||||
MOZ_BRANDING_DIRECTORY=
|
MOZ_BRANDING_DIRECTORY=
|
||||||
|
@ -4270,6 +4271,7 @@ browser)
|
||||||
MOZ_APP_VERSION=$FIREFOX_VERSION
|
MOZ_APP_VERSION=$FIREFOX_VERSION
|
||||||
MOZ_NO_XPCOM_OBSOLETE=1
|
MOZ_NO_XPCOM_OBSOLETE=1
|
||||||
MOZ_EXTENSIONS_DEFAULT=" xml-rpc inspector gnomevfs reporter"
|
MOZ_EXTENSIONS_DEFAULT=" xml-rpc inspector gnomevfs reporter"
|
||||||
|
MOZ_ENABLE_LIBXUL=1
|
||||||
AC_DEFINE(MOZ_PHOENIX)
|
AC_DEFINE(MOZ_PHOENIX)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -6750,10 +6752,6 @@ MOZ_ARG_ENABLE_BOOL(libxul,
|
||||||
MOZ_ENABLE_LIBXUL=1,
|
MOZ_ENABLE_LIBXUL=1,
|
||||||
MOZ_ENABLE_LIBXUL=)
|
MOZ_ENABLE_LIBXUL=)
|
||||||
|
|
||||||
if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
|
|
||||||
AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
|
if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
|
||||||
AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
|
AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
|
||||||
fi
|
fi
|
||||||
|
@ -6765,6 +6763,13 @@ else
|
||||||
XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
|
XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# A Firefox static build is really a meta-component build, not truly static
|
||||||
|
if test "$MOZ_BUILD_APP" = "browser" -a -n "$BUILD_STATIC_LIBS"; then
|
||||||
|
MOZ_META_COMPONENT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(MOZ_META_COMPONENT)
|
||||||
|
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
dnl = Force JS to be a static lib
|
dnl = Force JS to be a static lib
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
|
|
|
@ -54,6 +54,10 @@ MODULE=unicharutil
|
||||||
LIBRARY_NAME=unicharutil_external_s
|
LIBRARY_NAME=unicharutil_external_s
|
||||||
DIST_INSTALL = 1
|
DIST_INSTALL = 1
|
||||||
|
|
||||||
|
ifdef MOZ_META_COMPONENT
|
||||||
|
EXPORT_LIBRARY = 1
|
||||||
|
endif
|
||||||
|
|
||||||
REQUIRES=xpcom \
|
REQUIRES=xpcom \
|
||||||
string \
|
string \
|
||||||
uconv \
|
uconv \
|
||||||
|
|
|
@ -51,9 +51,12 @@ include $(DEPTH)/config/autoconf.mk
|
||||||
MODULE=unicharutil
|
MODULE=unicharutil
|
||||||
LIBRARY_NAME=unicharutil_s
|
LIBRARY_NAME=unicharutil_s
|
||||||
DIST_INSTALL = 1
|
DIST_INSTALL = 1
|
||||||
EXPORT_LIBRARY = 1
|
|
||||||
MOZILLA_INTERNAL_API = 1
|
MOZILLA_INTERNAL_API = 1
|
||||||
|
|
||||||
|
ifndef MOZ_META_COMPONENT
|
||||||
|
EXPORT_LIBRARY = 1
|
||||||
|
endif
|
||||||
|
|
||||||
include $(srcdir)/../objs.mk
|
include $(srcdir)/../objs.mk
|
||||||
|
|
||||||
EXTRA_DEPS += $(srcdir)/../objs.mk
|
EXTRA_DEPS += $(srcdir)/../objs.mk
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
#
|
#
|
||||||
# ***** END LICENSE BLOCK *****
|
# ***** END LICENSE BLOCK *****
|
||||||
|
|
||||||
|
# This makefile links all the static components which have EXPORT_LIBRARY
|
||||||
|
# set into a single component DLL.
|
||||||
|
|
||||||
DEPTH = ../..
|
DEPTH = ../..
|
||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
|
@ -42,131 +45,32 @@ VPATH = @srcdir@
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
ifdef MOZ_STATIC_COMPONENTS
|
LIBRARY_NAME = appmeta
|
||||||
MODULE = staticmod
|
|
||||||
LIBRARY_NAME = staticmod
|
|
||||||
SHORT_LIBNAME = statcmod
|
|
||||||
endif
|
|
||||||
|
|
||||||
IS_COMPONENT = 1
|
IS_COMPONENT = 1
|
||||||
|
FORCE_SHARED_LIB = 1
|
||||||
|
|
||||||
|
CPPSRCS = nsMetaModule.cpp
|
||||||
|
|
||||||
|
REQUIRES = xpcom
|
||||||
|
|
||||||
include $(topsrcdir)/config/config.mk
|
include $(topsrcdir)/config/config.mk
|
||||||
|
|
||||||
REQUIRES = xpcom \
|
FINAL_COMPONENT_LIBS := $(shell cat $(FINAL_LINK_COMPS))
|
||||||
$(NULL)
|
FINAL_LINK_LIBS := $(shell cat $(FINAL_LINK_LIBS))
|
||||||
|
|
||||||
ifdef MOZ_STATIC_COMPONENTS
|
|
||||||
CPPSRCS = nsStaticModule.cpp
|
|
||||||
endif
|
|
||||||
|
|
||||||
LOCAL_INCLUDES = -I$(srcdir)
|
|
||||||
|
|
||||||
#
|
|
||||||
# _COMPONENT_BASE is the base name of the meta component library
|
|
||||||
# that we are building in the current pass of this makefile
|
|
||||||
#
|
|
||||||
# mozcomps is a special name used to specify that we want to link all
|
|
||||||
# of the non-meta components into this special meta component
|
|
||||||
#
|
|
||||||
ifdef _COMPONENT_BASE
|
|
||||||
ifeq ($(_COMPONENT_BASE),mozcomps)
|
|
||||||
_FINAL_COMPONENT_NAMES := $(shell cat $(FINAL_LINK_COMP_NAMES))
|
|
||||||
_FINAL_COMPONENT_LIBS := $(shell cat $(FINAL_LINK_COMPS))
|
|
||||||
_FINAL_LINK_LIBS := $(shell cat $(FINAL_LINK_LIBS))
|
|
||||||
_META_COMPONENT_NAMES := _FINAL_COMPONENT_NAMES
|
|
||||||
_META_COMPONENT_LIBS := _FINAL_COMPONENT_LIBS
|
|
||||||
_META_DEP_LIBS := _FINAL_LINK_LIBS
|
|
||||||
else
|
|
||||||
_META_COMPONENT_NAMES := MOZ_META_COMPONENTS_$(_COMPONENT_BASE)
|
|
||||||
_META_COMPONENT_LIBS := MOZ_META_COMPONENTS_$(_COMPONENT_BASE)_comps
|
|
||||||
_META_DEP_LIBS := MOZ_META_COMPONENTS_$(_COMPONENT_BASE)_libs
|
|
||||||
endif # mozcomps
|
|
||||||
endif # _COMPONENT_BASE
|
|
||||||
|
|
||||||
ifdef MOZ_STATIC_COMPONENTS
|
|
||||||
SHARED_LIBRARY_LIBS = \
|
SHARED_LIBRARY_LIBS = \
|
||||||
$(foreach m, $(MOZ_STATIC_COMPONENTS), $(DIST)/lib/components/$(LIB_PREFIX)$(m).$(LIB_SUFFIX))
|
$(foreach c,$(FINAL_COMPONENT_LIBS),$(DIST)/lib/components/$(LIB_PREFIX)$(c).$(LIB_SUFFIX)) \
|
||||||
endif
|
$(foreach l,$(FINAL_LINK_LIBS),$(DIST)/lib/$(LIB_PREFIX)$(l).$(LIB_SUFFIX)) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
ifdef _COMPONENT_BASE
|
EXTRA_DSO_LDOPTS = \
|
||||||
ifneq ($(_COMPONENT_BASE),mozcomps)
|
$(XPCOM_GLUE_LDOPTS) \
|
||||||
SHARED_LIBRARY_LIBS = $(foreach m,$($(_META_COMPONENT_LIBS)), $(DIST)/lib/components/$(LIB_PREFIX)$(m).$(LIB_SUFFIX))
|
$(NSPR_LIBS) \
|
||||||
EXTRA_DSO_LDOPTS += $(foreach m,$($(_META_DEP_LIBS)), $(DIST)/lib/$(LIB_PREFIX)$(m).$(LIB_SUFFIX))
|
$(NULL)
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
|
||||||
# Create each meta component by calling this makefile recursively
|
|
||||||
# and forcing it to built a shared library meta component library
|
|
||||||
#
|
|
||||||
ifndef NO_RECURSE
|
|
||||||
libs clean distclean clobber realclean clobber_all::
|
|
||||||
set -e; \
|
|
||||||
for f in $(MOZ_META_COMPONENTS); do \
|
|
||||||
$(MAKE) NO_RECURSE=1 BUILD_STATIC_LIBS= LIBRARY_NAME=meta_$$f CPPSRCS=nsMetaModule_$$f.cpp _COMPONENT_BASE=$$f $@ ; \
|
|
||||||
done
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(LIBRARY_NAME),meta_mozcomps)
|
|
||||||
include $(topsrcdir)/config/static-config.mk
|
|
||||||
EXTRA_DSO_LIBS = $(STATIC_EXTRA_DSO_LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
ifeq ($(LIBRARY_NAME),meta_mozcomps)
|
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT
|
||||||
include $(topsrcdir)/config/static-rules.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef MOZ_STATIC_COMPONENTS
|
|
||||||
EXTRA_DSO_LDOPTS += \
|
|
||||||
$(ZLIB_LIBS) \
|
|
||||||
$(XPCOM_LIBS) \
|
|
||||||
$(MOZ_JS_LIBS) \
|
|
||||||
$(NSPR_LIBS) \
|
|
||||||
$(PNG_LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef MOZ_META_COMPONENTS
|
|
||||||
# Force XPCOM_TRANSLATE_NSGM_ENTRY_POINT to be defined so the macros
|
|
||||||
# in nsIGenericFactory.h will come out in the wash.
|
|
||||||
DEFINES += -DMETA_MODULE=\"$(LIBRARY_NAME)\" -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT
|
|
||||||
|
|
||||||
ifeq ($(LIBRARY_NAME),meta_mail)
|
|
||||||
EXTRA_DSO_LDOPTS += \
|
|
||||||
$(LIBS_DIR) \
|
|
||||||
$(call EXPAND_MOZLIBNAME,xpcom_compat gkgfx rdfutil_s) \
|
|
||||||
$(MOZ_UNICHARUTIL_LIBS) \
|
|
||||||
$(MOZ_COMPONENT_LIBS) \
|
|
||||||
$(TK_LIBS) \
|
|
||||||
$(NULL)
|
|
||||||
endif # meta_mail
|
|
||||||
|
|
||||||
ifeq ($(LIBRARY_NAME),meta_crypto)
|
|
||||||
EXTRA_DSO_LDOPTS += \
|
|
||||||
$(MOZ_JS_LIBS) \
|
|
||||||
$(NSS_LIBS) \
|
|
||||||
$(MOZ_UNICHARUTIL_LIBS) \
|
|
||||||
$(MOZ_COMPONENT_LIBS) \
|
|
||||||
$(NULL)
|
|
||||||
endif # meta_crypto
|
|
||||||
|
|
||||||
ifeq ($(LIBRARY_NAME),meta_mozcomps)
|
|
||||||
|
|
||||||
# We don't want to link mozcomps against NSS if not necessary
|
|
||||||
ifneq (,$(findstring crypto,$(MOZ_META_COMPONENTS)))
|
|
||||||
STATIC_EXTRA_LIBS := $(filter-out $(NSS_LIBS),$(STATIC_EXTRA_LIBS))
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DSO_LDOPTS += \
|
|
||||||
$(LIBS_DIR) \
|
|
||||||
$(EXTRA_DSO_LIBS) \
|
|
||||||
$(STATIC_EXTRA_LIBS) \
|
|
||||||
$(MOZ_JS_LIBS) \
|
|
||||||
$(MOZ_UNICHARUTIL_LIBS) \
|
|
||||||
$(MOZ_COMPONENT_LIBS) \
|
|
||||||
$(TK_LIBS) \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||||
OS_LIBS += -framework QuickTime
|
OS_LIBS += -framework QuickTime
|
||||||
|
@ -176,39 +80,32 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
||||||
OS_LIBS += -framework Cocoa
|
OS_LIBS += -framework Cocoa
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif # meta_mozcomps
|
|
||||||
|
|
||||||
endif # MOZ_META_COMPONENTS
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
OS_LIBS += ole32.lib shell32.lib
|
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool imm32)
|
||||||
|
# XXX temporary workaround until link ordering issue is solved
|
||||||
|
ifdef GNU_CC
|
||||||
|
OS_LIBS += $(call EXPAND_LIBNAME,winmm wsock32 gdi32)
|
||||||
|
endif
|
||||||
|
ifdef MOZ_ENABLE_CAIRO_GFX
|
||||||
|
OS_LIBS += $(call EXPAND_LIBNAME, usp10)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GARBAGE += $(CPPSRCS)
|
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)$(MOZ_ENABLE_XLIB))
|
||||||
|
OS_LIBS += $(XLDFLAGS) $(XT_LIBS)
|
||||||
list:
|
|
||||||
echo $(MOZ_STATIC_COMPONENTS)
|
|
||||||
|
|
||||||
ifdef _NO_AUTO_VARS
|
|
||||||
_TARGET = $(srcdir)/$(@F)
|
|
||||||
GARBAGE += $(addprefix $(srcdir)/,$(CPPSRCS))
|
|
||||||
else
|
|
||||||
_TARGET = $@
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef MOZ_STATIC_COMPONENTS
|
OS_LIBS += $(TK_LIBS)
|
||||||
nsStaticModule.cpp: nsMetaModule.cpp.in Makefile Makefile.in $(DEPTH)/config/autoconf.mk
|
|
||||||
rm -f $@
|
|
||||||
cat $< | \
|
|
||||||
sed -e "s|%DECLARE_SUBMODULE_INFOS%|$(foreach m, $(MOZ_STATIC_COMPONENTS), extern nsModuleInfo NSMODULEINFO($(m));)|" | \
|
|
||||||
sed -e "s|%SUBMODULE_INFOS%|$(foreach m, $(MOZ_STATIC_COMPONENTS), \\& NSMODULEINFO($(m)),)|" \
|
|
||||||
> $(_TARGET)
|
|
||||||
endif
|
|
||||||
|
|
||||||
nsMetaModule_%.cpp: nsMetaModule.cpp.in Makefile Makefile.in $(topsrcdir)/config/config.mk
|
GARBAGE += module_list.h
|
||||||
rm -f $@
|
|
||||||
cat $< | \
|
|
||||||
sed -e "s|%DECLARE_SUBMODULE_INFOS%|$(foreach m, $($(_META_COMPONENT_NAMES)), extern nsModuleInfo NSMODULEINFO($(m));)|" | \
|
|
||||||
sed -e "s|%SUBMODULE_INFOS%|$(foreach m, $($(_META_COMPONENT_NAMES)), \\& NSMODULEINFO($(m)),)|" \
|
|
||||||
> $(_TARGET)
|
|
||||||
|
|
||||||
|
LOCAL_INCLUDES += -I.
|
||||||
|
|
||||||
|
FINAL_COMPONENT_NAMES := $(shell cat $(FINAL_LINK_COMP_NAMES))
|
||||||
|
|
||||||
|
nsMetaModule.$(OBJ_SUFFIX): module_list.h
|
||||||
|
|
||||||
|
module_list.h: Makefile Makefile.in $(DEPTH)/config/autoconf.mk
|
||||||
|
echo '#define MODULES \' > $@
|
||||||
|
awk '{ print "MODULE(" $$1 ") \\" }' < $(FINAL_LINK_COMP_NAMES) >> $@
|
||||||
|
echo >> $@
|
||||||
|
|
|
@ -0,0 +1,167 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* The Original Code is mozilla.org code.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is
|
||||||
|
* Netscape Communications Corporation.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Christopher Seawood <cls@seawood.org>
|
||||||
|
* Doug Turner <dougt@netscape.com>
|
||||||
|
* Chris Waterson <waterson@netscape.com>
|
||||||
|
* Benjamin Smedberg <benjamin@smedbergs.us>
|
||||||
|
*
|
||||||
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
* the provisions above, a recipient may use your version of this file under
|
||||||
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
#include "nsIGenericFactory.h"
|
||||||
|
#include "nsXPCOM.h"
|
||||||
|
#include "nsIModule.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
|
#include "nsCOMArray.h"
|
||||||
|
#include "nsMemory.h"
|
||||||
|
#include "nsAutoPtr.h"
|
||||||
|
|
||||||
|
#include "module_list.h"
|
||||||
|
|
||||||
|
#define NSGETMODULE(_name) _name##_NSGetModule
|
||||||
|
|
||||||
|
#define MODULE(_name) \
|
||||||
|
NSGETMODULE_ENTRY_POINT(_name) (nsIComponentManager*, nsIFile*, nsIModule**);
|
||||||
|
|
||||||
|
MODULES
|
||||||
|
|
||||||
|
#undef MODULE
|
||||||
|
|
||||||
|
#define MODULE(_name) NSGETMODULE(_name),
|
||||||
|
|
||||||
|
static const nsGetModuleProc kGetModules[] = {
|
||||||
|
MODULES
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef MODULE
|
||||||
|
|
||||||
|
class MetaModule : public nsIModule
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NS_DECL_ISUPPORTS
|
||||||
|
NS_DECL_NSIMODULE
|
||||||
|
|
||||||
|
MetaModule() { }
|
||||||
|
nsresult Init(nsIComponentManager*, nsIFile*);
|
||||||
|
|
||||||
|
private:
|
||||||
|
~MetaModule() { }
|
||||||
|
|
||||||
|
nsCOMArray<nsIModule> mModules;
|
||||||
|
};
|
||||||
|
|
||||||
|
NS_IMPL_THREADSAFE_ISUPPORTS1(MetaModule, nsIModule)
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
MetaModule::Init(nsIComponentManager* aCompMgr, nsIFile* aLocation)
|
||||||
|
{
|
||||||
|
if (!mModules.SetCapacity(NS_ARRAY_LENGTH(kGetModules)))
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
// eat all errors
|
||||||
|
nsGetModuleProc const *end = kGetModules + NS_ARRAY_LENGTH(kGetModules);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIModule> module;
|
||||||
|
for (nsGetModuleProc const *cur = kGetModules; cur < end; ++cur) {
|
||||||
|
nsresult rv = (*cur)(aCompMgr, aLocation, getter_AddRefs(module));
|
||||||
|
if (NS_SUCCEEDED(rv))
|
||||||
|
mModules.AppendObject(module);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
MetaModule::GetClassObject(nsIComponentManager* aCompMgr, REFNSCID aCID,
|
||||||
|
REFNSIID aIID, void **aResult)
|
||||||
|
{
|
||||||
|
for (PRInt32 i = mModules.Count() - 1; i >= 0; --i) {
|
||||||
|
nsresult rv = mModules[i]->GetClassObject(aCompMgr, aCID,
|
||||||
|
aIID, aResult);
|
||||||
|
if (NS_SUCCEEDED(rv))
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
MetaModule::RegisterSelf(nsIComponentManager* aCompMgr, nsIFile* aLocation,
|
||||||
|
const char *aStr, const char *aType)
|
||||||
|
{
|
||||||
|
for (PRInt32 i = mModules.Count() - 1; i >= 0; --i) {
|
||||||
|
mModules[i]->RegisterSelf(aCompMgr, aLocation, aStr, aType);
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
MetaModule::UnregisterSelf(nsIComponentManager* aCompMgr, nsIFile* aLocation,
|
||||||
|
const char *aStr)
|
||||||
|
{
|
||||||
|
for (PRInt32 i = mModules.Count() - 1; i >= 0; --i) {
|
||||||
|
mModules[i]->UnregisterSelf(aCompMgr, aLocation, aStr);
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
MetaModule::CanUnload(nsIComponentManager* aCompMgr, PRBool *aResult)
|
||||||
|
{
|
||||||
|
for (PRInt32 i = mModules.Count() - 1; i >= 0; --i) {
|
||||||
|
nsresult rv = mModules[i]->CanUnload(aCompMgr, aResult);
|
||||||
|
if (NS_FAILED(rv))
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
// Any submodule may veto unloading
|
||||||
|
if (!*aResult)
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" NS_EXPORT nsresult
|
||||||
|
NSGetModule(nsIComponentManager *servMgr,
|
||||||
|
nsIFile *location,
|
||||||
|
nsIModule **result)
|
||||||
|
{
|
||||||
|
nsRefPtr<MetaModule> mmodule = new MetaModule();
|
||||||
|
nsresult rv = mmodule->Init(servMgr, location);
|
||||||
|
if (NS_FAILED(rv))
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
NS_ADDREF(*result = mmodule);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
|
@ -111,7 +111,7 @@ CPPSRCS = \
|
||||||
|
|
||||||
DEFINES += -DIMPL_XREAPI
|
DEFINES += -DIMPL_XREAPI
|
||||||
|
|
||||||
ifndef BUILD_STATIC_LIBS
|
ifneq (1_,$(BUILD_STATIC_LIBS)_$(MOZ_META_COMPONENT))
|
||||||
CPPSRCS += nsEmbedFunctions.cpp
|
CPPSRCS += nsEmbedFunctions.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -179,12 +179,14 @@ endif
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
ifdef BUILD_STATIC_LIBS
|
ifdef BUILD_STATIC_LIBS
|
||||||
|
ifndef MOZ_META_COMPONENT
|
||||||
export::
|
export::
|
||||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) Apprunner
|
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) Apprunner
|
||||||
# embedding/browser/gtk/src/Makefile.in sucks! we need to add an empty line to
|
# embedding/browser/gtk/src/Makefile.in sucks! we need to add an empty line to
|
||||||
# FINAL_LINK_COMPS to keep the two lists in sync :-(
|
# FINAL_LINK_COMPS to keep the two lists in sync :-(
|
||||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) ""
|
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) ""
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_INCLUDES += \
|
LOCAL_INCLUDES += \
|
||||||
-I$(srcdir) \
|
-I$(srcdir) \
|
||||||
|
|
Загрузка…
Ссылка в новой задаче