bug 357427 Make the nullplugin use nsIPrefBranch instead of nsIPref

r+sr=jst


git-svn-id: svn://10.0.0.236/trunk@213953 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de
2006-10-21 16:01:14 +00:00
parent 52daff9b1f
commit b104860503
2 changed files with 18 additions and 12 deletions

View File

@@ -46,7 +46,8 @@
#include "dialogs.h"
#include "dbg.h"
#include "nsIServiceManager.h"
#include "nsIPref.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
nsIServiceManager * gServiceManager = NULL;
@@ -218,7 +219,7 @@ BOOL CPlugin::init(HWND hWndParent)
dbgOut1("CPlugin::init()");
nsISupports * sm = NULL;
nsIPref * nsPrefService = NULL;
nsIPrefBranch * prefBranch = NULL;
PRBool bSendUrls = PR_FALSE; // default to false if problem getting pref
// note that Mozilla will add reference, so do not forget to release
@@ -232,10 +233,12 @@ BOOL CPlugin::init(HWND hWndParent)
if (gServiceManager) {
// get service using its contract id and use it to allocate the memory
gServiceManager->GetServiceByContractID(NS_PREF_CONTRACTID, NS_GET_IID(nsIPref), (void **)&nsPrefService);
if(nsPrefService) {
nsPrefService->GetBoolPref("application.use_ns_plugin_finder", &bSendUrls);
NS_RELEASE(nsPrefService);
gServiceManager->GetServiceByContractID(NS_PREFSERVICE_CONTRACTID,
NS_GET_IID(nsIPrefBranch),
(void **)&prefBranch);
if(prefBranch) {
prefBranch->GetBoolPref("application.use_ns_plugin_finder", &bSendUrls);
NS_RELEASE(prefBranch);
}
}
m_bSmartUpdate = bSendUrls;