Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsObjectFrame.cpp File Reference
#include "nscore.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsHTMLParts.h"
#include "nsHTMLContainerFrame.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
#include "nsStyleSet.h"
#include "nsWidgetsCID.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsIDOMKeyListener.h"
#include "nsIPluginHost.h"
#include "nsplugin.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "prmem.h"
#include "nsHTMLAtoms.h"
#include "nsIDocument.h"
#include "nsIHTMLDocument.h"
#include "nsINodeInfo.h"
#include "nsIPluginElement.h"
#include "nsIURL.h"
#include "nsNetUtil.h"
#include "nsIPluginInstanceOwner.h"
#include "nsISupportsArray.h"
#include "plstr.h"
#include "nsILinkHandler.h"
#include "nsINameSpaceManager.h"
#include "nsIEventListener.h"
#include "nsIScrollableView.h"
#include "nsIScrollPositionListener.h"
#include "nsIStringStream.h"
#include "nsITimer.h"
#include "nsLayoutAtoms.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIWebNavigation.h"
#include "nsIWebNavigationInfo.h"
#include "nsDocShellCID.h"
#include "nsIWebBrowserChrome.h"
#include "nsIDOMElement.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIDOMHTMLEmbedElement.h"
#include "nsIDOMHTMLAppletElement.h"
#include "nsIDOMElementCSSInlineStyle.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMCSS2Properties.h"
#include "nsContentPolicyUtils.h"
#include "nsIDOMWindow.h"
#include "nsIDOMDocumentEvent.h"
#include "nsIDOMMouseListener.h"
#include "nsIDOMMouseMotionListener.h"
#include "nsIDOMFocusListener.h"
#include "nsIDOMContextMenuListener.h"
#include "nsIDOMDragListener.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMNSEvent.h"
#include "nsITextContent.h"
#include "nsIPrivateDOMEvent.h"
#include "nsIDocumentEncoder.h"
#include "nsXPIDLString.h"
#include "nsIDOMRange.h"
#include "nsIPluginWidget.h"
#include "nsGUIEvent.h"
#include "nsIRenderingContext.h"
#include "npapi.h"
#include "nsGfxCIID.h"
#include "nsUnicharUtils.h"
#include "nsTransform2D.h"
#include "nsIImageLoadingContent.h"
#include "nsPIDOMWindow.h"
#include "nsContentUtils.h"
#include "nsIStringBundle.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptContext.h"
#include "nsIXPConnect.h"
#include "nsIXPCScriptable.h"
#include "nsIClassInfo.h"
#include "jsapi.h"
#include "nsStyleContext.h"
#include "nsMimeTypes.h"
#include "nsIMIMEService.h"
#include "nsCExternalHandlerService.h"
#include "imgILoader.h"
#include "nsObjectFrame.h"
#include "nsIObjectFrame.h"
#include "nsPluginNativeWindow.h"
#include "nsPIPluginHost.h"
#include "nsIPluginDocument.h"
#include "prlog.h"
#include <errno.h>
#include "nsContentCID.h"

Go to the source code of this file.

Classes

class  nsPluginDOMContextMenuListener
class  nsPluginInstanceOwner
struct  moz2javaCharset

Defines

#define EMBED_DEF_WIDTH   240
#define EMBED_DEF_HEIGHT   200

Functions

static NS_DEFINE_CID (kRangeCID, NS_RANGE_CID)
 NS_IMETHODIMP_ (nsrefcnt) nsObjectFrame
static NS_DEFINE_CID (kWidgetCID, NS_CHILD_CID)
static NS_DEFINE_CID (kCAppShellCID, NS_APPSHELL_CID)
static NS_DEFINE_CID (kCPluginManagerCID, NS_PLUGINMANAGER_CID)
static PRBool IsSupportedImage (const nsCString &aMimeType)
static PRBool IsSupportedDocument (nsIContent *aOurContent, const nsCString &aMimeType)
static void FirePluginNotFoundEvent (nsIContent *aTarget)
static void SizeAnchor (nsIContent *aAnchor, PRInt32 aWidth, PRInt32 aHeight)
nsresult NS_NewObjectFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)

Variables

static PRBool sDefaultPluginDisabled = 0xffffffff
static nsHashtable * gCharsetMap = nsnull
static const moz2javaCharset charsets []

Class Documentation

struct moz2javaCharset

Definition at line 2855 of file nsObjectFrame.cpp.

Class Members
char javaName
char mozName

Define Documentation

Definition at line 880 of file nsObjectFrame.cpp.

Definition at line 879 of file nsObjectFrame.cpp.


Function Documentation

static void FirePluginNotFoundEvent ( nsIContent aTarget) [static]

Definition at line 592 of file nsObjectFrame.cpp.

{
  nsCOMPtr<nsIDOMDocumentEvent> eventDoc =
    do_QueryInterface(aTarget->GetDocument());
  nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(aTarget));

  if (eventDoc) {
    nsCOMPtr<nsIDOMEvent> event;
    nsresult rv = eventDoc->CreateEvent(NS_LITERAL_STRING("Events"),
                                        getter_AddRefs(event));
    if (NS_SUCCEEDED(rv)) {
      rv = event->InitEvent(NS_LITERAL_STRING("PluginNotFound"), PR_TRUE,
                            PR_TRUE);
      if (NS_SUCCEEDED(rv)) {
        nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
        privateEvent->SetTrusted(PR_TRUE);

        PRBool defaultActionEnabled;
        target->DispatchEvent(event, &defaultActionEnabled);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool IsSupportedDocument ( nsIContent aOurContent,
const nsCString aMimeType 
) [static]

Definition at line 510 of file nsObjectFrame.cpp.

{
  nsresult rv;

  // only allow browser to handle content of <embed> for svg (bug 240408)
  if (aOurContent->Tag() == nsHTMLAtoms::embed)
#ifdef MOZ_SVG
    if (!aMimeType.LowerCaseEqualsLiteral("image/svg+xml"))
#endif
      return PR_FALSE;


  nsCOMPtr<nsIWebNavigationInfo> info(
    do_GetService(NS_WEBNAVIGATION_INFO_CONTRACTID, &rv));
  PRUint32 supported;
  if (info) {
    nsCOMPtr<nsIWebNavigation> webNav =
      do_GetInterface(aOurContent->GetCurrentDoc()->GetScriptGlobalObject());
    rv = info->IsTypeSupported(aMimeType, webNav, &supported);
  }

  return NS_SUCCEEDED(rv) &&
    supported != nsIWebNavigationInfo::UNSUPPORTED &&
    supported != nsIWebNavigationInfo::PLUGIN;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool IsSupportedImage ( const nsCString aMimeType) [static]

Definition at line 499 of file nsObjectFrame.cpp.

{
  nsCOMPtr<imgILoader> loader(do_GetService("@mozilla.org/image/loader;1"));

  PRBool supported;
  nsresult rv = loader->SupportImageWithMimeType(aMimeType.get(), &supported);

  return NS_SUCCEEDED(rv) && supported;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kRangeCID  ,
NS_RANGE_CID   
) [static]
static NS_DEFINE_CID ( kWidgetCID  ,
NS_CHILD_CID   
) [static]
static NS_DEFINE_CID ( kCAppShellCID  ,
NS_APPSHELL_CID   
) [static]
static NS_DEFINE_CID ( kCPluginManagerCID  ,
NS_PLUGINMANAGER_CID   
) [static]

Definition at line 453 of file nsObjectFrame.cpp.

{
  NS_WARNING("not supported for frames");
  return 1;
}
nsresult NS_NewObjectFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 2204 of file nsObjectFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");
  if (nsnull == aNewFrame) {
    return NS_ERROR_NULL_POINTER;
  }
  nsObjectFrame* it = new (aPresShell) nsObjectFrame;
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  *aNewFrame = it;
  return NS_OK;
}

Here is the caller graph for this function:

static void SizeAnchor ( nsIContent aAnchor,
PRInt32  aWidth,
PRInt32  aHeight 
) [static]

Definition at line 979 of file nsObjectFrame.cpp.

{
  nsCOMPtr<nsIDOMElementCSSInlineStyle> element(do_QueryInterface(aAnchor));

  if (!element)
    return;

  nsCOMPtr<nsIDOMCSSStyleDeclaration> style;
  element->GetStyle(getter_AddRefs(style));

  nsCOMPtr<nsIDOMCSS2Properties> css2props(do_QueryInterface(style));

  if (!css2props) {
    return;
  }

  nsAutoString tmp;
  tmp.AppendInt(aWidth);
  AppendASCIItoUTF16("px", tmp);
  css2props->SetWidth(tmp);

  tmp.Truncate();
  tmp.AppendInt(aHeight);
  AppendASCIItoUTF16("px", tmp);
  css2props->SetHeight(tmp);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 2867 of file nsObjectFrame.cpp.

nsHashtable* gCharsetMap = nsnull [static]

Definition at line 2854 of file nsObjectFrame.cpp.

PRBool sDefaultPluginDisabled = 0xffffffff [static]

Definition at line 180 of file nsObjectFrame.cpp.