Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsMailnewsContentBlocker.cpp File Reference
#include "nsMailnewsContentBlocker.h"
#include "nsIURI.h"
#include "nsIServiceManager.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMWindow.h"
#include "nsIDocShellTreeItem.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranch2.h"
#include "nsIDocShell.h"
#include "nsContentPolicyUtils.h"
#include "nsString.h"
#include "nsCRT.h"

Go to the source code of this file.


#define PREF_CHANGED(_P)   (!aPref || !strcmp(aPref, _P))


 NS_IMPL_ISUPPORTS3 (nsMailnewsContentBlocker, nsIContentPolicy, nsIObserver, nsSupportsWeakReference) nsMailnewsContentBlocker
static already_AddRefed
< nsIDocShell
GetRootDocShell (nsISupports *context)
 Helper function to get the root DocShell given a context.


static const char kBlockRemotePrefName [] = "mailnews.message_display.disable_remote_image"
static const PRBool kBlockRemotePrefDefault = PR_FALSE

Define Documentation

#define PREF_CHANGED (   _P)    (!aPref || !strcmp(aPref, _P))

Function Documentation

static already_AddRefed<nsIDocShell> GetRootDocShell ( nsISupports *  context) [inline, static]

Helper function to get the root DocShell given a context.

aContextThe context (can be null)
the root DocShell containing aContext, if found

Definition at line 104 of file nsMailnewsContentBlocker.cpp.

  nsIDocShell *docshell = NS_CP_GetDocShellFromContext(context);
  if (!docshell)
    return nsnull;

  nsresult rv;
  nsCOMPtr<nsIDocShellTreeItem> docshellTreeItem(do_QueryInterface(docshell, &rv));
  if (NS_FAILED(rv))
    return nsnull;

  nsCOMPtr<nsIDocShellTreeItem> rootItem;
  // we want the app docshell, so don't use GetSameTypeRootTreeItem
  rv = docshellTreeItem->GetRootTreeItem(getter_AddRefs(rootItem));
  if (NS_FAILED(rv))
    return nsnull;

  nsIDocShell *result;
  CallQueryInterface(rootItem, &result);
  return result;

Here is the call graph for this function:

NS_IMPL_ISUPPORTS3 ( nsMailnewsContentBlocker  ,
nsIContentPolicy  ,
nsIObserver  ,

Definition at line 61 of file nsMailnewsContentBlocker.cpp.

  : mBlockRemotePref(kBlockRemotePrefDefault)

Variable Documentation

Definition at line 58 of file nsMailnewsContentBlocker.cpp.

const char kBlockRemotePrefName[] = "mailnews.message_display.disable_remote_image" [static]

Definition at line 57 of file nsMailnewsContentBlocker.cpp.