r=pollmann
d=Adding Gecko user agent string.
This commit is contained in:
waqar%netscape.com 2000-04-13 20:07:13 +00:00
Родитель 8439797630
Коммит 26b333776d
4 изменённых файлов: 38 добавлений и 2 удалений

Просмотреть файл

@ -26,6 +26,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
BUILD_DATE = gbdate.h
MODULE = layout
LIBRARY_NAME = raptorhtml
@ -43,7 +44,7 @@ ifndef MKSHLIB_FORCE_ALL
CPPSRCS += dlldeps.cpp
endif
EXPORTS = nsLayoutCID.h
EXPORTS = nsLayoutCID.h $(BUILD_DATE)
SHARED_LIBRARY_LIBS = \
$(DIST)/lib/libraptorevents_s.a \
@ -107,3 +108,7 @@ endif
$(LIBRARY) $(SHARED_LIBRARY): $(SHARED_LIBRARY_LIBS) Makefile
$(BUILD_DATE): FORCE
$(RM) $@
$(PERL) gbdate.pl > $@

Просмотреть файл

@ -28,6 +28,8 @@ MODULE=raptor
REQUIRES=xpcom raptor dom js
IS_COMPONENT = 1
BUILD_DATE=gbdate.h
CPPSRCS=dlldeps.cpp nsLayoutDLF.cpp nsLayoutFactory.cpp
CPP_OBJS= \
@ -37,7 +39,7 @@ CPP_OBJS= \
.\$(OBJDIR)\nsLayoutModule.obj \
$(NULL)
EXPORTS=nsLayoutCID.h
EXPORTS=nsLayoutCID.h $(BUILD_DATE)
MAKE_OBJ_TYPE = DLL
@ -108,3 +110,7 @@ install:: $(DLL)
clobber::
rm -f $(DIST)\bin\$(DLLNAME).dll
rm -f $(DIST)\lib\$(DLLNAME).lib
$(BUILD_DATE)::
rm -f $@
$(PERL) gbdate.pl > $@

Просмотреть файл

@ -63,7 +63,11 @@
#include "nsIServiceManager.h"
#include "nsTextTransformer.h"
#include "nsIHTTPProtocolHandler.h"
#include "gbdate.h"
#define PRODUCT_NAME "Gecko"
static NS_DEFINE_CID(kHTTPHandlerCID, NS_IHTTPHANDLER_CID);
static nsLayoutModule *gModule = NULL;
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
@ -223,6 +227,8 @@ nsLayoutModule::Initialize()
}
}
SetUserAgent();
rv = nsTextTransformer::Initialize();
if (NS_FAILED(rv)) {
return rv;
@ -413,3 +419,20 @@ nsLayoutModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
*okToUnload = PR_FALSE;
return NS_ERROR_FAILURE;
}
void
nsLayoutModule::SetUserAgent( void )
{
nsString productName(PRODUCT_NAME), productVersion(PRODUCT_VERSION);
nsresult rv = nsnull;
nsCOMPtr<nsIHTTPProtocolHandler> theService(do_GetService(kHTTPHandlerCID,
&rv));
if( NS_SUCCEEDED(rv) && (nsnull != theService) )
{
rv = theService->SetProduct(productName.GetUnicode());
rv = theService->SetProductSub(productVersion.GetUnicode());
}
}

Просмотреть файл

@ -50,6 +50,8 @@ protected:
void UnregisterDocumentFactories(nsIComponentManager* aCompMgr,
nsIFile* aPath);
void SetUserAgent();
PRBool mInitialized;
// static nsIFactory* gFactory;
static nsIScriptNameSetRegistry* gRegistry;