зеркало из https://github.com/mozilla/pjs.git
Add a command-line parameter, "-autoRegister", to allow automated component registration for static builds. r=ben.
This commit is contained in:
Родитель
7b9483e645
Коммит
1be4f943b3
|
@ -43,7 +43,15 @@
|
||||||
#include "nsIIOService.h"
|
#include "nsIIOService.h"
|
||||||
#include "nsCocoaBrowserService.h"
|
#include "nsCocoaBrowserService.h"
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
|
#include "nsEmbedAPI.h"
|
||||||
#import "CHAboutBox.h"
|
#import "CHAboutBox.h"
|
||||||
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
#include "nsStaticComponent.h"
|
||||||
|
nsresult PR_CALLBACK
|
||||||
|
app_GetModuleInfo(NSStaticModuleInfo **info, PRUint32 *count);
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
|
|
||||||
|
@ -52,6 +60,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
-(id)init
|
-(id)init
|
||||||
{
|
{
|
||||||
if ( (self = [super init]) ) {
|
if ( (self = [super init]) ) {
|
||||||
|
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
if ([defaults boolForKey:@"autoRegister"]) {
|
||||||
|
// This option causes us to simply initialize embedding and exit.
|
||||||
|
NSString *path = [[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent];
|
||||||
|
setenv("MOZILLA_FIVE_HOME", [path fileSystemRepresentation], 1);
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
NSGetStaticModuleInfo = app_GetModuleInfo;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (NS_SUCCEEDED(NS_InitEmbedding(nsnull, nsnull)))
|
||||||
|
NS_TermEmbedding();
|
||||||
|
|
||||||
|
[NSApp terminate:self];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
||||||
mFindDialog = nil;
|
mFindDialog = nil;
|
||||||
mMenuBookmarks = nil;
|
mMenuBookmarks = nil;
|
||||||
|
|
|
@ -43,7 +43,15 @@
|
||||||
#include "nsIIOService.h"
|
#include "nsIIOService.h"
|
||||||
#include "nsCocoaBrowserService.h"
|
#include "nsCocoaBrowserService.h"
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
|
#include "nsEmbedAPI.h"
|
||||||
#import "CHAboutBox.h"
|
#import "CHAboutBox.h"
|
||||||
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
#include "nsStaticComponent.h"
|
||||||
|
nsresult PR_CALLBACK
|
||||||
|
app_GetModuleInfo(NSStaticModuleInfo **info, PRUint32 *count);
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
|
|
||||||
|
@ -52,6 +60,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
-(id)init
|
-(id)init
|
||||||
{
|
{
|
||||||
if ( (self = [super init]) ) {
|
if ( (self = [super init]) ) {
|
||||||
|
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
if ([defaults boolForKey:@"autoRegister"]) {
|
||||||
|
// This option causes us to simply initialize embedding and exit.
|
||||||
|
NSString *path = [[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent];
|
||||||
|
setenv("MOZILLA_FIVE_HOME", [path fileSystemRepresentation], 1);
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
NSGetStaticModuleInfo = app_GetModuleInfo;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (NS_SUCCEEDED(NS_InitEmbedding(nsnull, nsnull)))
|
||||||
|
NS_TermEmbedding();
|
||||||
|
|
||||||
|
[NSApp terminate:self];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
||||||
mFindDialog = nil;
|
mFindDialog = nil;
|
||||||
mMenuBookmarks = nil;
|
mMenuBookmarks = nil;
|
||||||
|
|
|
@ -43,7 +43,15 @@
|
||||||
#include "nsIIOService.h"
|
#include "nsIIOService.h"
|
||||||
#include "nsCocoaBrowserService.h"
|
#include "nsCocoaBrowserService.h"
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
|
#include "nsEmbedAPI.h"
|
||||||
#import "CHAboutBox.h"
|
#import "CHAboutBox.h"
|
||||||
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
#include "nsStaticComponent.h"
|
||||||
|
nsresult PR_CALLBACK
|
||||||
|
app_GetModuleInfo(NSStaticModuleInfo **info, PRUint32 *count);
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
|
|
||||||
|
@ -52,6 +60,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
-(id)init
|
-(id)init
|
||||||
{
|
{
|
||||||
if ( (self = [super init]) ) {
|
if ( (self = [super init]) ) {
|
||||||
|
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
if ([defaults boolForKey:@"autoRegister"]) {
|
||||||
|
// This option causes us to simply initialize embedding and exit.
|
||||||
|
NSString *path = [[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent];
|
||||||
|
setenv("MOZILLA_FIVE_HOME", [path fileSystemRepresentation], 1);
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
NSGetStaticModuleInfo = app_GetModuleInfo;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (NS_SUCCEEDED(NS_InitEmbedding(nsnull, nsnull)))
|
||||||
|
NS_TermEmbedding();
|
||||||
|
|
||||||
|
[NSApp terminate:self];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
||||||
mFindDialog = nil;
|
mFindDialog = nil;
|
||||||
mMenuBookmarks = nil;
|
mMenuBookmarks = nil;
|
||||||
|
|
|
@ -43,7 +43,15 @@
|
||||||
#include "nsIIOService.h"
|
#include "nsIIOService.h"
|
||||||
#include "nsCocoaBrowserService.h"
|
#include "nsCocoaBrowserService.h"
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
|
#include "nsEmbedAPI.h"
|
||||||
#import "CHAboutBox.h"
|
#import "CHAboutBox.h"
|
||||||
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
#include "nsStaticComponent.h"
|
||||||
|
nsresult PR_CALLBACK
|
||||||
|
app_GetModuleInfo(NSStaticModuleInfo **info, PRUint32 *count);
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
|
|
||||||
|
@ -52,6 +60,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||||
-(id)init
|
-(id)init
|
||||||
{
|
{
|
||||||
if ( (self = [super init]) ) {
|
if ( (self = [super init]) ) {
|
||||||
|
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
if ([defaults boolForKey:@"autoRegister"]) {
|
||||||
|
// This option causes us to simply initialize embedding and exit.
|
||||||
|
NSString *path = [[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent];
|
||||||
|
setenv("MOZILLA_FIVE_HOME", [path fileSystemRepresentation], 1);
|
||||||
|
|
||||||
|
#ifdef _BUILD_STATIC_BIN
|
||||||
|
NSGetStaticModuleInfo = app_GetModuleInfo;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (NS_SUCCEEDED(NS_InitEmbedding(nsnull, nsnull)))
|
||||||
|
NS_TermEmbedding();
|
||||||
|
|
||||||
|
[NSApp terminate:self];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
mSplashScreen = [[CHSplashScreenWindow alloc] splashImage:nil withFade:YES withStatusRect:NSMakeRect(0,0,0,0)];
|
||||||
mFindDialog = nil;
|
mFindDialog = nil;
|
||||||
mMenuBookmarks = nil;
|
mMenuBookmarks = nil;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче