mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 12:13:22 +00:00
Oops, this got accidentally checked. Backing out.
This commit is contained in:
parent
5ba9439c07
commit
0294527edd
@ -89,8 +89,6 @@
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
|
||||
|
||||
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
|
||||
@ -398,26 +396,6 @@ nsEventListenerManager::AddEventListener(nsIDOMEventListener *aListener,
|
||||
{
|
||||
NS_ENSURE_TRUE(aListener, NS_ERROR_FAILURE);
|
||||
|
||||
if (aSubType & NS_EVENT_BITS_CONTEXTMENU) {
|
||||
nsCOMPtr<nsIPrefService> prefService =
|
||||
do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
|
||||
NS_ENSURE_TRUE(prefService, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch;
|
||||
prefService->GetBranch(nsnull, getter_AddRefs(prefBranch));
|
||||
|
||||
PRBool blockOnContextMenu = PR_FALSE;
|
||||
// dom.disable.event.oncontextmenu ???
|
||||
prefBranch->GetBoolPref("pref.name.here", &blockOnContextMenu);
|
||||
|
||||
// Only chrome is allowed to add a context menu listener if our
|
||||
// pref is set to true.
|
||||
if (blockOnContextMenu && !nsContentUtils::IsCallerChrome()) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
nsVoidArray* listeners = GetListenersByType(aType, aKey, PR_TRUE);
|
||||
|
||||
//We asked the GetListenersByType to create the array if it had to. If it didn't
|
||||
|
Loading…
x
Reference in New Issue
Block a user