зеркало из https://github.com/mozilla/pjs.git
more prep for bug 119923 - use chrome registry ContractID rather than CID, so that we can drop in a new embedding-only chrome registry
r=bnesse, sr=dveditz, a=asa
This commit is contained in:
Родитель
64aeed153c
Коммит
eb04da966b
|
@ -157,9 +157,6 @@ interface nsIXULChromeRegistry : nsIChromeRegistry {
|
||||||
|
|
||||||
%{ C++
|
%{ C++
|
||||||
|
|
||||||
// for component registration
|
#define NS_CHROMEREGISTRY_CONTRACTID \
|
||||||
// {D8C7D8A2-E84C-11d2-BF87-00105A1B0627}
|
"@mozilla.org/chrome/chrome-registry;1"
|
||||||
#define NS_CHROMEREGISTRY_CID \
|
|
||||||
{ 0xd8c7d8a2, 0xe84c, 0x11d2, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
|
@ -54,7 +54,7 @@ static const nsModuleComponentInfo components[] =
|
||||||
{
|
{
|
||||||
{ "Chrome Registry",
|
{ "Chrome Registry",
|
||||||
NS_CHROMEREGISTRY_CID,
|
NS_CHROMEREGISTRY_CID,
|
||||||
"@mozilla.org/chrome/chrome-registry;1",
|
NS_CHROMEREGISTRY_CONTRACTID,
|
||||||
nsChromeRegistryConstructor
|
nsChromeRegistryConstructor
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||||
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
|
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
|
||||||
|
@ -593,7 +592,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
|
||||||
// Canonify the "chrome:" URL; e.g., so that we collapse
|
// Canonify the "chrome:" URL; e.g., so that we collapse
|
||||||
// "chrome://navigator/content/navigator.xul" and "chrome://navigator/content"
|
// "chrome://navigator/content/navigator.xul" and "chrome://navigator/content"
|
||||||
// and "chrome://navigator/content/navigator.xul".
|
// and "chrome://navigator/content/navigator.xul".
|
||||||
nsCOMPtr<nsIChromeRegistry> reg(do_GetService(kChromeRegistryCID, &rv));
|
nsCOMPtr<nsIChromeRegistry> reg(do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
rv = reg->Canonify(aURI);
|
rv = reg->Canonify(aURI);
|
||||||
|
|
|
@ -54,6 +54,12 @@ class nsIDocument;
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
|
||||||
|
|
||||||
|
// for component registration
|
||||||
|
// {D8C7D8A2-E84C-11d2-BF87-00105A1B0627}
|
||||||
|
#define NS_CHROMEREGISTRY_CID \
|
||||||
|
{ 0xd8c7d8a2, 0xe84c, 0x11d2, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||||
|
|
||||||
class nsChromeRegistry : public nsIXULChromeRegistry,
|
class nsChromeRegistry : public nsIXULChromeRegistry,
|
||||||
public nsIObserver,
|
public nsIObserver,
|
||||||
public nsSupportsWeakReference
|
public nsSupportsWeakReference
|
||||||
|
|
|
@ -355,8 +355,6 @@ static PRBool IsChromeOrResourceURI(nsIURI* aURI)
|
||||||
/* Implementation file */
|
/* Implementation file */
|
||||||
NS_IMPL_ISUPPORTS3(nsXBLDocumentInfo, nsIXBLDocumentInfo, nsIScriptGlobalObjectOwner, nsISupportsWeakReference)
|
NS_IMPL_ISUPPORTS3(nsXBLDocumentInfo, nsIXBLDocumentInfo, nsIScriptGlobalObjectOwner, nsISupportsWeakReference)
|
||||||
|
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
|
|
||||||
nsXBLDocumentInfo::nsXBLDocumentInfo(const char* aDocURI, nsIDocument* aDocument)
|
nsXBLDocumentInfo::nsXBLDocumentInfo(const char* aDocURI, nsIDocument* aDocument)
|
||||||
{
|
{
|
||||||
NS_INIT_ISUPPORTS();
|
NS_INIT_ISUPPORTS();
|
||||||
|
@ -370,7 +368,7 @@ nsXBLDocumentInfo::nsXBLDocumentInfo(const char* aDocURI, nsIDocument* aDocument
|
||||||
mDocument->GetDocumentURL(getter_AddRefs(uri));
|
mDocument->GetDocumentURL(getter_AddRefs(uri));
|
||||||
if (IsChromeOrResourceURI(uri)) {
|
if (IsChromeOrResourceURI(uri)) {
|
||||||
// Cache whether or not this chrome XBL can execute scripts.
|
// Cache whether or not this chrome XBL can execute scripts.
|
||||||
nsCOMPtr<nsIXULChromeRegistry> reg(do_GetService(kChromeRegistryCID));
|
nsCOMPtr<nsIXULChromeRegistry> reg(do_GetService(NS_CHROMEREGISTRY_CONTRACTID));
|
||||||
if (reg) {
|
if (reg) {
|
||||||
PRBool allow = PR_TRUE;
|
PRBool allow = PR_TRUE;
|
||||||
reg->AllowScriptsForSkin(uri, &allow);
|
reg->AllowScriptsForSkin(uri, &allow);
|
||||||
|
|
|
@ -168,7 +168,6 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
static NS_DEFINE_CID(kCSSLoaderCID, NS_CSS_LOADER_CID);
|
static NS_DEFINE_CID(kCSSLoaderCID, NS_CSS_LOADER_CID);
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
static NS_DEFINE_CID(kEventListenerManagerCID, NS_EVENTLISTENERMANAGER_CID);
|
static NS_DEFINE_CID(kEventListenerManagerCID, NS_EVENTLISTENERMANAGER_CID);
|
||||||
static NS_DEFINE_CID(kHTMLCSSStyleSheetCID, NS_HTML_CSS_STYLESHEET_CID);
|
static NS_DEFINE_CID(kHTMLCSSStyleSheetCID, NS_HTML_CSS_STYLESHEET_CID);
|
||||||
static NS_DEFINE_CID(kHTMLElementFactoryCID, NS_HTML_ELEMENT_FACTORY_CID);
|
static NS_DEFINE_CID(kHTMLElementFactoryCID, NS_HTML_ELEMENT_FACTORY_CID);
|
||||||
|
@ -1752,7 +1751,8 @@ nsXULDocument::EndLoad()
|
||||||
IsChromeURI(uri))
|
IsChromeURI(uri))
|
||||||
gXULCache->WritePrototype(mCurrentPrototype);
|
gXULCache->WritePrototype(mCurrentPrototype);
|
||||||
|
|
||||||
nsCOMPtr<nsIXULChromeRegistry> reg(do_GetService(kChromeRegistryCID, &rv));
|
nsCOMPtr<nsIXULChromeRegistry> reg =
|
||||||
|
do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
nsCOMPtr<nsISupportsArray> sheets;
|
nsCOMPtr<nsISupportsArray> sheets;
|
||||||
|
@ -5380,7 +5380,7 @@ nsresult
|
||||||
nsXULDocument::AddChromeOverlays()
|
nsXULDocument::AddChromeOverlays()
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<nsIXULChromeRegistry> reg(do_GetService(kChromeRegistryCID, &rv));
|
nsCOMPtr<nsIXULChromeRegistry> reg(do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv));
|
||||||
|
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
|
@ -132,7 +132,6 @@ static NS_DEFINE_CID(kHTMLEditorCID, NS_HTMLEDITOR_CID);
|
||||||
static NS_DEFINE_CID(kCTextServicesDocumentCID, NS_TEXTSERVICESDOCUMENT_CID);
|
static NS_DEFINE_CID(kCTextServicesDocumentCID, NS_TEXTSERVICESDOCUMENT_CID);
|
||||||
static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||||
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
|
|
||||||
#define APP_DEBUG 0
|
#define APP_DEBUG 0
|
||||||
|
|
||||||
|
@ -3798,7 +3797,7 @@ nsEditorShell::InitSpellChecker()
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIXULChromeRegistry> packageRegistry =
|
nsCOMPtr<nsIXULChromeRegistry> packageRegistry =
|
||||||
do_GetService(kChromeRegistryCID, &result);
|
do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &result);
|
||||||
|
|
||||||
if (NS_SUCCEEDED(result) && packageRegistry)
|
if (NS_SUCCEEDED(result) && packageRegistry)
|
||||||
result = packageRegistry->GetSelectedLocale(NS_LITERAL_STRING("navigator").get(), &dictName);
|
result = packageRegistry->GetSelectedLocale(NS_LITERAL_STRING("navigator").get(), &dictName);
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
|
#include "nsIAtom.h"
|
||||||
|
|
||||||
// Interfaces Needed
|
// Interfaces Needed
|
||||||
#include "nsIDocShell.h"
|
#include "nsIDocShell.h"
|
||||||
|
@ -183,7 +184,6 @@ static NS_DEFINE_CID(kPrefMigrationCID, NS_PREFMIGRATION_CID);
|
||||||
static NS_DEFINE_CID(kPrefConverterCID, NS_PREFCONVERTER_CID);
|
static NS_DEFINE_CID(kPrefConverterCID, NS_PREFCONVERTER_CID);
|
||||||
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
|
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
|
||||||
|
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||||
|
|
||||||
|
|
||||||
|
@ -457,7 +457,8 @@ nsProfile::StartupWithArgs(nsICmdLineService *cmdLineArgs, PRBool canInteract)
|
||||||
}
|
}
|
||||||
gLocaleProfiles->Remove(&key);
|
gLocaleProfiles->Remove(&key);
|
||||||
|
|
||||||
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(kChromeRegistryCID, &rv);
|
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry =
|
||||||
|
do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
// Install to the profile
|
// Install to the profile
|
||||||
|
@ -1621,7 +1622,8 @@ nsProfile::CreateNewProfileWithLocales(const PRUnichar* profileName,
|
||||||
rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR, getter_AddRefs(profDefaultsDir));
|
rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR, getter_AddRefs(profDefaultsDir));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(kChromeRegistryCID, &rv);
|
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry =
|
||||||
|
do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
|
||||||
const PRUnichar* uiLocale = aUILocale;
|
const PRUnichar* uiLocale = aUILocale;
|
||||||
|
@ -2123,7 +2125,7 @@ nsProfile::DefineLocaleDefaultsDir()
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIXULChromeRegistry> packageRegistry =
|
nsCOMPtr<nsIXULChromeRegistry> packageRegistry =
|
||||||
do_GetService(kChromeRegistryCID, &rv);
|
do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
{
|
{
|
||||||
nsXPIDLString localeName;
|
nsXPIDLString localeName;
|
||||||
|
|
|
@ -54,7 +54,7 @@ static const nsModuleComponentInfo components[] =
|
||||||
{
|
{
|
||||||
{ "Chrome Registry",
|
{ "Chrome Registry",
|
||||||
NS_CHROMEREGISTRY_CID,
|
NS_CHROMEREGISTRY_CID,
|
||||||
"@mozilla.org/chrome/chrome-registry;1",
|
NS_CHROMEREGISTRY_CONTRACTID,
|
||||||
nsChromeRegistryConstructor
|
nsChromeRegistryConstructor
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -157,9 +157,6 @@ interface nsIXULChromeRegistry : nsIChromeRegistry {
|
||||||
|
|
||||||
%{ C++
|
%{ C++
|
||||||
|
|
||||||
// for component registration
|
#define NS_CHROMEREGISTRY_CONTRACTID \
|
||||||
// {D8C7D8A2-E84C-11d2-BF87-00105A1B0627}
|
"@mozilla.org/chrome/chrome-registry;1"
|
||||||
#define NS_CHROMEREGISTRY_CID \
|
|
||||||
{ 0xd8c7d8a2, 0xe84c, 0x11d2, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||||
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
|
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
|
||||||
|
@ -593,7 +592,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
|
||||||
// Canonify the "chrome:" URL; e.g., so that we collapse
|
// Canonify the "chrome:" URL; e.g., so that we collapse
|
||||||
// "chrome://navigator/content/navigator.xul" and "chrome://navigator/content"
|
// "chrome://navigator/content/navigator.xul" and "chrome://navigator/content"
|
||||||
// and "chrome://navigator/content/navigator.xul".
|
// and "chrome://navigator/content/navigator.xul".
|
||||||
nsCOMPtr<nsIChromeRegistry> reg(do_GetService(kChromeRegistryCID, &rv));
|
nsCOMPtr<nsIChromeRegistry> reg(do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
rv = reg->Canonify(aURI);
|
rv = reg->Canonify(aURI);
|
||||||
|
|
|
@ -54,6 +54,12 @@ class nsIDocument;
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
|
||||||
|
|
||||||
|
// for component registration
|
||||||
|
// {D8C7D8A2-E84C-11d2-BF87-00105A1B0627}
|
||||||
|
#define NS_CHROMEREGISTRY_CID \
|
||||||
|
{ 0xd8c7d8a2, 0xe84c, 0x11d2, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||||
|
|
||||||
class nsChromeRegistry : public nsIXULChromeRegistry,
|
class nsChromeRegistry : public nsIXULChromeRegistry,
|
||||||
public nsIObserver,
|
public nsIObserver,
|
||||||
public nsSupportsWeakReference
|
public nsSupportsWeakReference
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 3 -*- */
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
|
@ -99,13 +99,27 @@ class nsProxiedService
|
||||||
nsProxiedService(const nsCID &aClass, const nsIID &aIID,
|
nsProxiedService(const nsCID &aClass, const nsIID &aIID,
|
||||||
nsIEventQueue* pIProxyQueue, PRBool always, nsresult*rv)
|
nsIEventQueue* pIProxyQueue, PRBool always, nsresult*rv)
|
||||||
{
|
{
|
||||||
static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID);
|
|
||||||
|
|
||||||
|
|
||||||
*rv = nsServiceManager::GetService(aClass,
|
*rv = nsServiceManager::GetService(aClass,
|
||||||
aIID,
|
aIID,
|
||||||
getter_AddRefs(mService));
|
getter_AddRefs(mService));
|
||||||
if (NS_FAILED(*rv)) return;
|
if (NS_FAILED(*rv)) return;
|
||||||
|
InitProxy(aIID, pIProxyQueue, always, rv);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsProxiedService(const char* aContractID, const nsIID &aIID,
|
||||||
|
nsIEventQueue* pIProxyQueue, PRBool always, nsresult*rv)
|
||||||
|
{
|
||||||
|
*rv = nsServiceManager::GetService(aContractID,
|
||||||
|
aIID,
|
||||||
|
getter_AddRefs(mService));
|
||||||
|
if (NS_FAILED(*rv)) return;
|
||||||
|
InitProxy(aIID, pIProxyQueue, always, rv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitProxy(const nsIID &aIID, nsIEventQueue* pIProxyQueue,
|
||||||
|
PRBool always, nsresult*rv)
|
||||||
|
{
|
||||||
|
static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID);
|
||||||
|
|
||||||
nsCOMPtr<nsIProxyObjectManager> pIProxyObjectManager =
|
nsCOMPtr<nsIProxyObjectManager> pIProxyObjectManager =
|
||||||
do_GetService(kProxyObjectManagerCID, rv);
|
do_GetService(kProxyObjectManagerCID, rv);
|
||||||
|
@ -119,8 +133,7 @@ class nsProxiedService
|
||||||
proxyType,
|
proxyType,
|
||||||
getter_AddRefs(mProxiedService));
|
getter_AddRefs(mProxiedService));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
~nsProxiedService()
|
~nsProxiedService()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,6 @@
|
||||||
#include "nsIXULWindow.h"
|
#include "nsIXULWindow.h"
|
||||||
#include "nsIChromeRegistry.h"
|
#include "nsIChromeRegistry.h"
|
||||||
#include "nsIContentHandler.h"
|
#include "nsIContentHandler.h"
|
||||||
#include "nsIBrowserInstance.h"
|
|
||||||
#include "nsIEventQueueService.h"
|
#include "nsIEventQueueService.h"
|
||||||
#include "nsDirectoryServiceDefs.h"
|
#include "nsDirectoryServiceDefs.h"
|
||||||
#include "nsIHttpProtocolHandler.h"
|
#include "nsIHttpProtocolHandler.h"
|
||||||
|
@ -116,7 +115,6 @@
|
||||||
|
|
||||||
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
|
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
|
||||||
static NS_DEFINE_CID(kIProcessCID, NS_PROCESS_CID);
|
static NS_DEFINE_CID(kIProcessCID, NS_PROCESS_CID);
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
|
|
||||||
#define UILOCALE_CMD_LINE_ARG "-UILocale"
|
#define UILOCALE_CMD_LINE_ARG "-UILocale"
|
||||||
#define CONTENTLOCALE_CMD_LINE_ARG "-contentLocale"
|
#define CONTENTLOCALE_CMD_LINE_ARG "-contentLocale"
|
||||||
|
@ -931,7 +929,7 @@ static nsresult ConvertToUnicode(nsString& aCharset, const char* inString, nsASt
|
||||||
static nsresult OpenBrowserWindow(PRInt32 height, PRInt32 width)
|
static nsresult OpenBrowserWindow(PRInt32 height, PRInt32 width)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<nsICmdLineHandler> handler(do_GetService(NS_BROWSERSTARTUPHANDLER_CONTRACTID, &rv));
|
nsCOMPtr<nsICmdLineHandler> handler(do_GetService("@mozilla.org/commandlinehandler/general-startup;1?type=browser", &rv));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
nsXPIDLCString chromeUrlForTask;
|
nsXPIDLCString chromeUrlForTask;
|
||||||
|
@ -1116,14 +1114,14 @@ static nsresult InstallGlobalLocale(nsICmdLineService *cmdLineArgs)
|
||||||
if (cmdUI) {
|
if (cmdUI) {
|
||||||
nsAutoString UILocaleName;
|
nsAutoString UILocaleName;
|
||||||
UILocaleName.AssignWithConversion(cmdUI);
|
UILocaleName.AssignWithConversion(cmdUI);
|
||||||
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(kChromeRegistryCID, &rv);
|
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if (chromeRegistry)
|
if (chromeRegistry)
|
||||||
rv = chromeRegistry->SelectLocale(UILocaleName.get(), PR_FALSE);
|
rv = chromeRegistry->SelectLocale(UILocaleName.get(), PR_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// match OS when no cmdline override
|
// match OS when no cmdline override
|
||||||
if (!cmdUI && matchOS) {
|
if (!cmdUI && matchOS) {
|
||||||
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(kChromeRegistryCID, &rv);
|
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if (chromeRegistry) {
|
if (chromeRegistry) {
|
||||||
chromeRegistry->SetRuntimeProvider(PR_TRUE);
|
chromeRegistry->SetRuntimeProvider(PR_TRUE);
|
||||||
rv = chromeRegistry->SelectLocale(uiLang.get(), PR_FALSE);
|
rv = chromeRegistry->SelectLocale(uiLang.get(), PR_FALSE);
|
||||||
|
@ -1136,14 +1134,14 @@ static nsresult InstallGlobalLocale(nsICmdLineService *cmdLineArgs)
|
||||||
if (cmdContent) {
|
if (cmdContent) {
|
||||||
nsAutoString ContentLocaleName;
|
nsAutoString ContentLocaleName;
|
||||||
ContentLocaleName.AssignWithConversion(cmdContent);
|
ContentLocaleName.AssignWithConversion(cmdContent);
|
||||||
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(kChromeRegistryCID, &rv);
|
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if(chromeRegistry)
|
if(chromeRegistry)
|
||||||
rv = chromeRegistry->SelectLocale(ContentLocaleName.get(), PR_FALSE);
|
rv = chromeRegistry->SelectLocale(ContentLocaleName.get(), PR_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// match OS when no cmdline override
|
// match OS when no cmdline override
|
||||||
if (!cmdContent && matchOS) {
|
if (!cmdContent && matchOS) {
|
||||||
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(kChromeRegistryCID, &rv);
|
nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
|
||||||
if (chromeRegistry) {
|
if (chromeRegistry) {
|
||||||
chromeRegistry->SetRuntimeProvider(PR_TRUE);
|
chromeRegistry->SetRuntimeProvider(PR_TRUE);
|
||||||
rv = chromeRegistry->SelectLocale(country.get(), PR_FALSE);
|
rv = chromeRegistry->SelectLocale(country.get(), PR_FALSE);
|
||||||
|
|
|
@ -86,7 +86,6 @@ static NS_DEFINE_CID(kInstallTrigger_CID, NS_SoftwareUpdateInstallTrigger_CID);
|
||||||
|
|
||||||
static NS_DEFINE_CID(kInstallVersion_CID, NS_SoftwareUpdateInstallVersion_CID);
|
static NS_DEFINE_CID(kInstallVersion_CID, NS_SoftwareUpdateInstallVersion_CID);
|
||||||
|
|
||||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
|
||||||
static NS_DEFINE_CID(knsRegistryCID, NS_REGISTRY_CID);
|
static NS_DEFINE_CID(knsRegistryCID, NS_REGISTRY_CID);
|
||||||
|
|
||||||
static NS_DEFINE_CID(kIProcessCID, NS_PROCESS_CID);
|
static NS_DEFINE_CID(kIProcessCID, NS_PROCESS_CID);
|
||||||
|
@ -315,7 +314,7 @@ nsSoftwareUpdate::InstallJar( nsIFile* aLocalFile,
|
||||||
nsIXULChromeRegistry* chromeRegistry = nsnull;
|
nsIXULChromeRegistry* chromeRegistry = nsnull;
|
||||||
NS_WITH_ALWAYS_PROXIED_SERVICE( nsIXULChromeRegistry,
|
NS_WITH_ALWAYS_PROXIED_SERVICE( nsIXULChromeRegistry,
|
||||||
tmpReg,
|
tmpReg,
|
||||||
kChromeRegistryCID,
|
NS_CHROMEREGISTRY_CONTRACTID,
|
||||||
NS_UI_THREAD_EVENTQ, &rv);
|
NS_UI_THREAD_EVENTQ, &rv);
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
chromeRegistry = tmpReg;
|
chromeRegistry = tmpReg;
|
||||||
|
@ -347,7 +346,7 @@ nsSoftwareUpdate::InstallChrome( PRUint32 aType,
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
NS_WITH_ALWAYS_PROXIED_SERVICE( nsIXULChromeRegistry,
|
NS_WITH_ALWAYS_PROXIED_SERVICE( nsIXULChromeRegistry,
|
||||||
chromeRegistry,
|
chromeRegistry,
|
||||||
kChromeRegistryCID,
|
NS_CHROMEREGISTRY_CONTRACTID,
|
||||||
NS_UI_THREAD_EVENTQ, &rv);
|
NS_UI_THREAD_EVENTQ, &rv);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче