Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
nsPopupWindowManager.cpp File Reference
#include "nsPopupWindowManager.h"
#include "nsCRT.h"
#include "nsIServiceManager.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranch2.h"

Go to the source code of this file.

Functions

 NS_IMPL_ISUPPORTS3 (nsPopupWindowManager, nsIPopupWindowManager, nsIObserver, nsSupportsWeakReference) nsresult nsPopupWindowManager

Variables

static const char kPopupDisablePref [] = "dom.disable_open_during_load"
 The Popup Window Manager maintains popup window permissions by website.

Function Documentation

NS_IMPL_ISUPPORTS3 ( nsPopupWindowManager  ,
nsIPopupWindowManager  ,
nsIObserver  ,
nsSupportsWeakReference   
)

Definition at line 65 of file nsPopupWindowManager.cpp.

{
  nsresult rv;
  mPermissionManager = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);

  nsCOMPtr<nsIPrefBranch2> prefBranch =
    do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
  if (NS_SUCCEEDED(rv)) {
    PRBool permission;
    rv = prefBranch->GetBoolPref(kPopupDisablePref, &permission);
    if (NS_FAILED(rv)) {
      permission = PR_TRUE;
    }
    mPolicy = permission ? (PRUint32) DENY_POPUP : (PRUint32) ALLOW_POPUP;

    prefBranch->AddObserver(kPopupDisablePref, this, PR_TRUE);
  } 

  return NS_OK;
}

Here is the call graph for this function:


Variable Documentation

const char kPopupDisablePref[] = "dom.disable_open_during_load" [static]

The Popup Window Manager maintains popup window permissions by website.

Definition at line 50 of file nsPopupWindowManager.cpp.