nsIPref is no longer passed around through inits on webshell, content viewers and presContext. In places where it is needed, it can be retrieved from the service manager. I removed a number of the getters and setters for prefs as the prefs will be the same from the service manager so we don't need getters. r=waterson a=rickg
git-svn-id: svn://10.0.0.236/trunk@62038 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIURIContentListener.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
@@ -262,13 +263,13 @@ nsPresContext::PreferenceChanged(const char* aPrefName)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::Init(nsIDeviceContext* aDeviceContext, nsIPref* aPrefs)
|
||||
nsPresContext::Init(nsIDeviceContext* aDeviceContext)
|
||||
{
|
||||
NS_ASSERTION(!(mInitialized == PR_TRUE), "attempt to reinit pres context");
|
||||
|
||||
mDeviceContext = dont_QueryInterface(aDeviceContext);
|
||||
|
||||
mPrefs = dont_QueryInterface(aPrefs);
|
||||
mPrefs = do_GetService(NS_PREF_PROGID);
|
||||
if (mPrefs) {
|
||||
// Register callbacks so we're notified when the preferences change
|
||||
mPrefs->RegisterCallback("browser.", PrefChangedCallback, (void*)this);
|
||||
@@ -322,18 +323,6 @@ nsPresContext::GetShell(nsIPresShell** aResult)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::GetPrefs(nsIPref** aResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aResult, "null ptr");
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
*aResult = mPrefs;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::GetCompatibilityMode(nsCompatibility* aResult)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user