Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
nsPluginInstanceOwner Class Reference
Inheritance diagram for nsPluginInstanceOwner:
Inheritance graph
[legend]
Collaboration diagram for nsPluginInstanceOwner:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsPluginInstanceOwner ()
virtual ~nsPluginInstanceOwner ()
NS_DECL_ISUPPORTS NS_IMETHOD SetInstance (nsIPluginInstance *aInstance)
NS_IMETHOD GetInstance (nsIPluginInstance *&aInstance)
NS_IMETHOD GetWindow (nsPluginWindow *&aWindow)
NS_IMETHOD GetMode (nsPluginMode *aMode)
NS_IMETHOD CreateWidget (void)
NS_IMETHOD GetURL (const char *aURL, const char *aTarget, void *aPostData, PRUint32 aPostDataLen, void *aHeadersData, PRUint32 aHeadersDataLen, PRBool isFile=PR_FALSE)
 Called when there is a valid target so that the proper frame can be updated with new content.
NS_IMETHOD ShowStatus (const char *aStatusMsg)
NS_IMETHOD ShowStatus (const PRUnichar *aStatusMsg)
NS_IMETHOD GetDocument (nsIDocument **aDocument)
NS_IMETHOD InvalidateRect (nsPluginRect *invalidRect)
NS_IMETHOD InvalidateRegion (nsPluginRegion invalidRegion)
NS_IMETHOD ForceRedraw ()
NS_IMETHOD GetValue (nsPluginInstancePeerVariable variable, void *value)
NS_IMETHOD PluginNotAvailable (const char *aMimeType)
NS_IMETHOD GetAttributes (PRUint16 &n, const char *const *&names, const char *const *&values)
NS_IMETHOD GetAttribute (const char *name, const char **result)
NS_IMETHOD GetTagType (nsPluginTagType *result)
NS_IMETHOD GetTagText (const char **result)
NS_IMETHOD GetParameters (PRUint16 &n, const char *const *&names, const char *const *&values)
NS_IMETHOD GetParameter (const char *name, const char **result)
NS_IMETHOD GetDocumentBase (const char **result)
NS_IMETHOD GetDocumentEncoding (const char **result)
NS_IMETHOD GetAlignment (const char **result)
NS_IMETHOD GetWidth (PRUint32 *result)
NS_IMETHOD GetHeight (PRUint32 *result)
NS_IMETHOD GetBorderVertSpace (PRUint32 *result)
NS_IMETHOD GetBorderHorizSpace (PRUint32 *result)
NS_IMETHOD GetUniqueID (PRUint32 *result)
NS_IMETHOD GetDOMElement (nsIDOMElement **result)
NS_IMETHOD MouseDown (nsIDOMEvent *aMouseEvent)
 nsIDOMMouseListener interfaces
NS_IMETHOD MouseUp (nsIDOMEvent *aMouseEvent)
 Processes a mouse up event.
NS_IMETHOD MouseClick (nsIDOMEvent *aMouseEvent)
 Processes a mouse click event.
NS_IMETHOD MouseDblClick (nsIDOMEvent *aMouseEvent)
 Processes a mouse click event.
NS_IMETHOD MouseOver (nsIDOMEvent *aMouseEvent)
 Processes a mouse enter event.
NS_IMETHOD MouseOut (nsIDOMEvent *aMouseEvent)
 Processes a mouse leave event.
NS_IMETHOD HandleEvent (nsIDOMEvent *aEvent)
NS_IMETHOD MouseMove (nsIDOMEvent *aMouseEvent)
 Processes a mouse move event.
NS_IMETHOD DragMove (nsIDOMEvent *aMouseEvent)
 Processes a drag move event.
NS_IMETHOD KeyDown (nsIDOMEvent *aKeyEvent)
 Processes a key pressed event.
NS_IMETHOD KeyUp (nsIDOMEvent *aKeyEvent)
 Processes a key release event.
NS_IMETHOD KeyPress (nsIDOMEvent *aKeyEvent)
 Processes a key typed event.
NS_IMETHOD Focus (nsIDOMEvent *aFocusEvent)
 Processes a focus event.
NS_IMETHOD Blur (nsIDOMEvent *aFocusEvent)
 Processes a blur event.
NS_IMETHOD DragEnter (nsIDOMEvent *aMouseEvent)
 Processes a drag enter event.
NS_IMETHOD DragOver (nsIDOMEvent *aMouseEvent)
 Processes a drag over event.
NS_IMETHOD DragExit (nsIDOMEvent *aMouseEvent)
 Processes a drag Exit event.
NS_IMETHOD DragDrop (nsIDOMEvent *aMouseEvent)
 Processes a drag drop event.
NS_IMETHOD DragGesture (nsIDOMEvent *aMouseEvent)
 Processes a drag gesture event.
nsresult Destroy ()
nsEventStatus ProcessEvent (const nsGUIEvent &anEvent)
 Processes all events.
void Paint (const nsRect &aDirtyRect, PRUint32 ndc=0)
NS_DECL_NSITIMERCALLBACK void CancelTimer ()
void StartTimer ()
NS_IMETHOD ScrollPositionWillChange (nsIScrollableView *aScrollable, nscoord aX, nscoord aY)
NS_IMETHOD ScrollPositionDidChange (nsIScrollableView *aScrollable, nscoord aX, nscoord aY)
NS_IMETHOD Init (nsPresContext *aPresContext, nsObjectFrame *aFrame)
nsPluginPort * GetPluginPort ()
void ReleasePluginPort (nsPluginPort *pluginPort)
void SetPluginHost (nsIPluginHost *aHost)
void setInstance (in nsIPluginInstance aInstance)
 Let the owner know that an instance has been created.
void getInstance (in nsIPluginInstanceRef aInstance)
 Get the instance associated with this owner.
void getWindow (in nsPluginWindowStarRef aWindow)
 Get a handle to the window structure of the owner.
void createWidget ()
 Create a place for the plugin to live in the owner's environment.
void showStatus (in string aStatusMsg)
 Show a status message in the host environment.
void invalidateRect (in nsPluginRectPtr aRect)
 Invalidate the rectangle.
void invalidateRegion (in nsPluginRegion aRegion)
 Invalidate the region.
void forceRedraw ()
 Force a redraw.
void getValue (in nsPluginInstancePeerVariable aVariable, in voidPtr aValue)
 Get the specified variable.
void pluginNotAvailable (in string aMimeType)
 Inform the owner that no plugin for the given mime type was found.
void getTagText (out constCharPtr aTagText)
 Get the complete text of the HTML tag that was used to instantiate this plugin.
void getParameters (in PRUint16Ref aCount, in constCharStarConstStar aNames, in constCharStarConstStar aValues)
 Get a ptr to the paired list of parameter names and values, returns the length of the array.
void getParameter (in string aName, out constCharPtr aResult)
 Get the value for the named parameter.
void getDocumentBase (out constCharPtr aDocumentBase)
 Get the document base.
void getDocumentEncoding (out constCharPtr aDocumentEncoding)
 Return an encoding whose name is specified in: http://java.sun.com/products/jdk/1.1/docs/guide/intl/intl.doc.html#25303.
void getAlignment (out constCharPtr aElignment)
 Get object alignment.
void getAttributes (in PRUint16Ref aCount, in constCharStarConstStar aNames, in constCharStarConstStar aValues)
 QueryInterface on nsIPluginInstancePeer to get this.
void getAttribute (in string aName, out constCharPtr aResult)
 Gets the value for the named attribute.
void notify (in nsITimer timer)
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Public Attributes

readonly attribute nsPluginMode mode
 Get the display mode for the plugin instance.
readonly attribute nsIDocument document
 Get the associated document.
readonly attribute nsPluginTagType tagType
 Get the type of the HTML tag that was used ot instantiate this plugin.
readonly attribute unsigned long width
 Get object width.
readonly attribute unsigned long height
 Get object height.
readonly attribute unsigned long borderVertSpace
 Get border vertical space.
readonly attribute unsigned long borderHorizSpace
 Get border horizontal space.
readonly attribute unsigned long uniqueID
 Returns a unique id for the current document containing plugin.
readonly attribute nsIDOMElement DOMElement
 Returns the DOM element corresponding to the tag which references this plugin in the document.

Private Member Functions

nsresult DispatchKeyToPlugin (nsIDOMEvent *aKeyEvent)
nsresult DispatchMouseToPlugin (nsIDOMEvent *aMouseEvent)
nsresult DispatchFocusToPlugin (nsIDOMEvent *aFocusEvent)
nsresult EnsureCachedAttrParamArrays ()

Private Attributes

nsPluginNativeWindowmPluginWindow
nsCOMPtr< nsIPluginInstancemInstance
nsObjectFramemOwner
nsCString mDocumentBase
char * mTagText
nsCOMPtr< nsIWidgetmWidget
nsPresContextmContext
nsCOMPtr< nsITimermPluginTimer
nsCOMPtr< nsIPluginHostmPluginHost
PRPackedBool mContentFocused
PRPackedBool mWidgetVisible
PRUint16 mNumCachedAttrs
PRUint16 mNumCachedParams
char ** mCachedAttrParamNames
char ** mCachedAttrParamValues
nsPluginDOMContextMenuListenermCXMenuListener
PRPackedBool mInDispatchFocus

Detailed Description

Definition at line 210 of file nsObjectFrame.cpp.


Constructor & Destructor Documentation

Definition at line 2283 of file nsObjectFrame.cpp.

{
  // create nsPluginNativeWindow object, it is derived from nsPluginWindow
  // struct and allows to manipulate native window procedure
  nsCOMPtr<nsIPluginHost> ph = do_GetService(kCPluginManagerCID);
  nsCOMPtr<nsPIPluginHost> pph(do_QueryInterface(ph));
  if (pph)
    pph->NewPluginNativeWindow(&mPluginWindow);
  else
    mPluginWindow = nsnull;

  mOwner = nsnull;
  mContext = nsnull;
  mTagText = nsnull;
  mContentFocused = PR_FALSE;
  mWidgetVisible = PR_TRUE;
  mNumCachedAttrs = 0;
  mNumCachedParams = 0;
  mCachedAttrParamNames = nsnull;
  mCachedAttrParamValues = nsnull;
  mInDispatchFocus = PR_FALSE;
}

Here is the call graph for this function:

Definition at line 2306 of file nsObjectFrame.cpp.

{
  PRInt32 cnt;

  // shut off the timer.
  if (mPluginTimer != nsnull) {
    CancelTimer();
  }

  mOwner = nsnull;

  for (cnt = 0; cnt < (mNumCachedAttrs + 1 + mNumCachedParams); cnt++) {
    if (mCachedAttrParamNames && mCachedAttrParamNames[cnt]) {
      PR_Free(mCachedAttrParamNames[cnt]);
      mCachedAttrParamNames[cnt] = nsnull;
    }

    if (mCachedAttrParamValues && mCachedAttrParamValues[cnt]) {
      PR_Free(mCachedAttrParamValues[cnt]);
      mCachedAttrParamValues[cnt] = nsnull;
    }
  }

  if (mCachedAttrParamNames) {
    PR_Free(mCachedAttrParamNames);
    mCachedAttrParamNames = nsnull;
  }

  if (mCachedAttrParamValues) {
    PR_Free(mCachedAttrParamValues);
    mCachedAttrParamValues = nsnull;
  }

  if (mTagText) {
    NS_Free(mTagText);
    mTagText = nsnull;
  }

  mContext = nsnull;

#if defined(XP_UNIX) && !defined(XP_MACOSX)
  // the mem for this struct is allocated
  // by PR_MALLOC in ns4xPluginInstance.cpp:ns4xPluginInstance::SetWindow()
  if (mPluginWindow && mPluginWindow->ws_info) {
    PR_Free(mPluginWindow->ws_info);
    mPluginWindow->ws_info = nsnull;
  }
#endif

  // clean up plugin native window object
  nsCOMPtr<nsIPluginHost> ph = do_GetService(kCPluginManagerCID);
  nsCOMPtr<nsPIPluginHost> pph(do_QueryInterface(ph));
  if (pph) {
    pph->DeletePluginNativeWindow(mPluginWindow);
    mPluginWindow = nsnull;
  }
}

Here is the call graph for this function:


Member Function Documentation

Processes a blur event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFocusListener.

Definition at line 3514 of file nsObjectFrame.cpp.

{
  mContentFocused = PR_FALSE;
  return DispatchFocusToPlugin(aFocusEvent);
}

Here is the call graph for this function:

Definition at line 4085 of file nsObjectFrame.cpp.

{
    if (mPluginTimer) {
        mPluginTimer->Cancel();
        mPluginTimer = nsnull;
    }
}

Here is the caller graph for this function:

Create a place for the plugin to live in the owner's environment.

this may or may not create a window depending on the windowless state of the plugin instance.

Definition at line 4184 of file nsObjectFrame.cpp.

{
  NS_ENSURE_TRUE(mPluginWindow, NS_ERROR_NULL_POINTER);

  nsIView   *view;
  nsresult  rv = NS_ERROR_FAILURE;

  if (mOwner) {
    // Create view if necessary

    view = mOwner->GetView();

    if (!view || !mWidget) {
      PRBool windowless = PR_FALSE;

      mInstance->GetValue(nsPluginInstanceVariable_WindowlessBool,
                          (void *)&windowless);

      // always create widgets in Twips, not pixels
      float p2t = mContext->ScaledPixelsToTwips();
      rv = mOwner->CreateWidget(NSIntPixelsToTwips(mPluginWindow->width, p2t),
                                NSIntPixelsToTwips(mPluginWindow->height, p2t),
                                windowless);
      if (NS_OK == rv) {
        view = mOwner->GetView();

        if (view) {
          mWidget = view->GetWidget();
          PRBool fTransparent = PR_FALSE;
          mInstance->GetValue(nsPluginInstanceVariable_TransparentBool,
                              (void *)&fTransparent);
          
          view->GetViewManager()->SetViewContentTransparency(view,
                                                             fTransparent);
        }

        if (PR_TRUE == windowless) {
          mPluginWindow->type = nsPluginWindowType_Drawable;

          // this needs to be a HDC according to the spec, but I do
          // not see the right way to release it so let's postpone
          // passing HDC till paint event when it is really
          // needed. Change spec?
          mPluginWindow->window = nsnull;
        } else if (mWidget) {
          mWidget->Resize(mPluginWindow->width, mPluginWindow->height,
                          PR_FALSE);

          // mPluginWindow->type is used in |GetPluginPort| so it must
          // be initilized first
          mPluginWindow->type = nsPluginWindowType_Window;
          mPluginWindow->window = GetPluginPort();

          // start the idle timer.
          StartTimer();

          // tell the plugin window about the widget
          mPluginWindow->SetPluginWidget(mWidget);
        }
      }
    }
  }

  return rv;
}

Here is the call graph for this function:

Definition at line 3913 of file nsObjectFrame.cpp.

{
  nsIContent* content = mOwner->GetContent();

  // stop the timer explicitly to reduce reference count.
  CancelTimer();

  // unregister context menu listener
  if (mCXMenuListener) {
    mCXMenuListener->Destroy(mOwner);    
    NS_RELEASE(mCXMenuListener);
  }

  nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content));
  if (receiver) {

    nsCOMPtr<nsIDOMEventListener> listener;
    QueryInterface(NS_GET_IID(nsIDOMEventListener), getter_AddRefs(listener));

    // Unregister focus event listener
    receiver->RemoveEventListenerByIID(listener, NS_GET_IID(nsIDOMFocusListener));

    // Unregister mouse event listener
    receiver->RemoveEventListenerByIID(listener, NS_GET_IID(nsIDOMMouseListener));

    // now for the mouse motion listener
    receiver->RemoveEventListenerByIID(listener, NS_GET_IID(nsIDOMMouseMotionListener));

    // Unregister key event listener;
    receiver->RemoveEventListener(NS_LITERAL_STRING("keypress"), listener, PR_TRUE);
    receiver->RemoveEventListener(NS_LITERAL_STRING("keydown"), listener, PR_TRUE);
    receiver->RemoveEventListener(NS_LITERAL_STRING("keyup"), listener, PR_TRUE);

    // Unregister drag event listener;
    receiver->RemoveEventListener(NS_LITERAL_STRING("dragdrop"), listener, PR_TRUE);
    receiver->RemoveEventListener(NS_LITERAL_STRING("dragover"), listener, PR_TRUE);
    receiver->RemoveEventListener(NS_LITERAL_STRING("dragexit"), listener, PR_TRUE);
    receiver->RemoveEventListener(NS_LITERAL_STRING("dragenter"), listener, PR_TRUE);
    receiver->RemoveEventListener(NS_LITERAL_STRING("draggesture"), listener, PR_TRUE);
  }

  // Unregister scroll position listener
  nsIFrame* parentWithView = mOwner->GetAncestorWithView();
  nsIView* curView = parentWithView ? parentWithView->GetView() : nsnull;
  while (curView) {
    nsIScrollableView* scrollingView = curView->ToScrollableView();
    if (scrollingView)
      scrollingView->RemoveScrollPositionListener((nsIScrollPositionListener *)this);
    
    curView = curView->GetParent();
  }

  mOwner = nsnull; // break relationship between frame and plugin instance owner

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3520 of file nsObjectFrame.cpp.

{
#if !(defined(XP_MAC) || defined(XP_MACOSX))
  if (!mPluginWindow || nsPluginWindowType_Window == mPluginWindow->type) {
    // continue only for cases without child window
    return aFocusEvent->PreventDefault(); // consume event
  }
#endif

  if (mInDispatchFocus) {
    NS_WARNING("nsPluginInstanceOwner::DispatchFocusToPlugin() called recursively on same plugin instance owner");
    return aFocusEvent->PreventDefault();
  }
  mInDispatchFocus = PR_TRUE;

  nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aFocusEvent));
  if (privateEvent) {
    nsEvent * theEvent;
    privateEvent->GetInternalNSEvent(&theEvent);
    if (theEvent) {
      // we only care about the message in ProcessEvent
      nsGUIEvent focusEvent(NS_IS_TRUSTED_EVENT(theEvent), theEvent->message,
                            nsnull);
      nsEventStatus rv = ProcessEvent(focusEvent);
      if (nsEventStatus_eConsumeNoDefault == rv) {
        aFocusEvent->PreventDefault();
        aFocusEvent->StopPropagation();
      }
    }
    else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchFocusToPlugin failed, focusEvent null");   
  }
  else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchFocusToPlugin failed, privateEvent null");   
  
  mInDispatchFocus = PR_FALSE;
  return NS_OK;
}    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3670 of file nsObjectFrame.cpp.

{
#if !(defined(XP_MAC) || defined(XP_MACOSX))
  if (!mPluginWindow || nsPluginWindowType_Window == mPluginWindow->type)
    return aKeyEvent->PreventDefault(); // consume event
  // continue only for cases without child window
#endif

  if (mInstance) {
    nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aKeyEvent));
    if (privateEvent) {
      nsKeyEvent* keyEvent = nsnull;
      privateEvent->GetInternalNSEvent((nsEvent**)&keyEvent);
      if (keyEvent) {
        nsEventStatus rv = ProcessEvent(*keyEvent);
        if (nsEventStatus_eConsumeNoDefault == rv) {
          aKeyEvent->PreventDefault();
          aKeyEvent->StopPropagation();
        }
      }
      else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchKeyToPlugin failed, keyEvent null");   
    }
    else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchKeyToPlugin failed, privateEvent null");   
  }

  return NS_OK;
}    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3804 of file nsObjectFrame.cpp.

{
#if !(defined(XP_MAC) || defined(XP_MACOSX))
  if (!mPluginWindow || nsPluginWindowType_Window == mPluginWindow->type)
    return aMouseEvent->PreventDefault(); // consume event
  // continue only for cases without child window
#endif

  // don't send mouse events if we are hiddden
  if (!mWidgetVisible)
    return NS_OK;

  nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
  if (privateEvent) {
    nsMouseEvent* mouseEvent = nsnull;
    privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
    if (mouseEvent) {
      nsEventStatus rv = ProcessEvent(*mouseEvent);
      if (nsEventStatus_eConsumeNoDefault == rv) {
        aMouseEvent->PreventDefault();
        aMouseEvent->StopPropagation();
      }
    }
    else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchMouseToPlugin failed, mouseEvent null");   
  }
  else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchMouseToPlugin failed, privateEvent null");   
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Processes a drag drop event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMDragListener.

Definition at line 3591 of file nsObjectFrame.cpp.

{
  if (mInstance) {
    // Let the plugin handle drag events.
    aMouseEvent->PreventDefault();
    aMouseEvent->StopPropagation();
  }

  return NS_OK;
}

Processes a drag enter event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMDragListener.

Definition at line 3558 of file nsObjectFrame.cpp.

{
  if (mInstance) {
    // Let the plugin handle drag events.
    aMouseEvent->PreventDefault();
    aMouseEvent->StopPropagation();
  }

  return NS_OK;
}

Processes a drag Exit event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMDragListener.

Definition at line 3580 of file nsObjectFrame.cpp.

{
  if (mInstance) {
    // Let the plugin handle drag events.
    aMouseEvent->PreventDefault();
    aMouseEvent->StopPropagation();
  }

  return NS_OK;
}

Processes a drag gesture event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMDragListener.

Definition at line 3602 of file nsObjectFrame.cpp.

{
  if (mInstance) {
    // Let the plugin handle drag events.
    aMouseEvent->PreventDefault();
    aMouseEvent->StopPropagation();
  }

  return NS_OK;
}
NS_IMETHOD nsPluginInstanceOwner::DragMove ( nsIDOMEvent aMouseEvent) [inline, virtual]

Processes a drag move event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseMotionListener.

Definition at line 327 of file nsObjectFrame.cpp.

{ return NS_OK; }

Processes a drag over event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMDragListener.

Definition at line 3569 of file nsObjectFrame.cpp.

{
  if (mInstance) {
    // Let the plugin handle drag events.
    aMouseEvent->PreventDefault();
    aMouseEvent->StopPropagation();
  }

  return NS_OK;
}

Definition at line 3167 of file nsObjectFrame.cpp.

{
  if (mCachedAttrParamValues)
    return NS_OK;

  NS_PRECONDITION(((mNumCachedAttrs + mNumCachedParams) == 0) &&
                  !mCachedAttrParamNames,
                  "re-cache of attrs/params not implemented! use the DOM "
                  "node directy instead");
  NS_ENSURE_TRUE(mOwner, NS_ERROR_NULL_POINTER);

  // first, we need to find out how much we need to allocate for our
  // arrays count up attributes
  mNumCachedAttrs = 0;

  nsIContent* content = mOwner->GetContent();
  nsresult rv = NS_OK;
  NS_ENSURE_TRUE(content, rv);

  PRUint32 cattrs = content->GetAttrCount();

  if (cattrs < 0x0000FFFF) {
    // unsigned 32 bits to unsigned 16 bits conversion
    mNumCachedAttrs = NS_STATIC_CAST(PRUint16, cattrs);
  } else {
    mNumCachedAttrs = 0xFFFE;  // minus one in case we add an extra "src" entry below
  }

  // now, we need to find all the PARAM tags that are children of us
  // however, be carefull NOT to include any PARAMs that don't have us
  // as a direct parent. For nested object (or applet) tags, be sure
  // to only round up the param tags that coorespond with THIS
  // instance. And also, weed out any bogus tags that may get in the
  // way, see bug 39609. Then, with any param tag that meet our
  // qualification, temporarly cache them in an nsISupportsArray until
  // we can figure out what size to make our fixed char* array.

  mNumCachedParams = 0;
  nsCOMPtr<nsISupportsArray> ourParams;
  rv = NS_NewISupportsArray(getter_AddRefs(ourParams));
  NS_ENSURE_SUCCESS(rv, rv);
 
  // use the DOM to get us ALL our dependant PARAM tags, even if not
  // ours
  nsCOMPtr<nsIDOMElement> mydomElement = do_QueryInterface(content);
  NS_ENSURE_TRUE(mydomElement, NS_ERROR_NO_INTERFACE);

  nsCOMPtr<nsIDOMNodeList> allParams; 

  nsINodeInfo *ni = content->GetNodeInfo();

  if (ni->NamespaceEquals(kNameSpaceID_XHTML)) {
    // For XHTML elements we need to take the namespace URI into
    // account when looking for param elements.

    NS_NAMED_LITERAL_STRING(xhtml_ns, "http://www.w3.org/1999/xhtml");

    mydomElement->GetElementsByTagNameNS(xhtml_ns, NS_LITERAL_STRING("param"),
                                         getter_AddRefs(allParams));
  } else {
    // If content is not XHTML, it must be HTML, no need to worry
    // about namespaces then...

    mydomElement->GetElementsByTagName(NS_LITERAL_STRING("param"),
                                       getter_AddRefs(allParams));
  }    

  if (allParams) {
    PRUint32 numAllParams; 
    allParams->GetLength(&numAllParams);
    // loop through every so called dependant PARAM tag to check if it
    // "belongs" to us

    for (PRUint32 i = 0; i < numAllParams; i++) {
      nsCOMPtr<nsIDOMNode> pnode;
      allParams->Item(i, getter_AddRefs(pnode));

      nsCOMPtr<nsIDOMElement> domelement = do_QueryInterface(pnode);
      if (domelement) {
        // let's NOT count up param tags that don't have a name attribute
        nsAutoString name;
        domelement->GetAttribute(NS_LITERAL_STRING("name"), name);
        if (!name.IsEmpty()) {
          nsCOMPtr<nsIDOMNode> parent;
          nsCOMPtr<nsIDOMHTMLObjectElement> domobject;
          nsCOMPtr<nsIDOMHTMLAppletElement> domapplet;
          pnode->GetParentNode(getter_AddRefs(parent));
          // walk up the parents of this PARAM until we find an object
          // (or applet) tag

          while (!(domobject || domapplet) && parent) {
            domobject = do_QueryInterface(parent);
            domapplet = do_QueryInterface(parent);
            nsCOMPtr<nsIDOMNode> temp;
            parent->GetParentNode(getter_AddRefs(temp));
            parent = temp;
          }

          if (domapplet || domobject) {
            if (domapplet)
              parent = do_QueryInterface(domapplet);
            else
              parent = do_QueryInterface(domobject);

            // now check to see if this PARAM's parent is us. if so,
            // cache it for later

            nsCOMPtr<nsIDOMNode> mydomNode = do_QueryInterface(mydomElement);
            if (parent == mydomNode) {
              ourParams->AppendElement(pnode);
            }
          }
        }
      }
    }
  }

  PRUint32 cparams;
  ourParams->Count(&cparams); // unsigned 32 bits to unsigned 16 bits conversion
  if (cparams < 0x0000FFFF)
    mNumCachedParams = NS_STATIC_CAST(PRUint16, cparams);
  else 
    mNumCachedParams = 0xFFFF;

  // Some plugins were never written to understand the "data" attribute of the OBJECT tag.
  // Real and WMP will not play unless they find a "src" attribute, see bug 152334.
  // Nav 4.x would simply replace the "data" with "src". Because some plugins correctly
  // look for "data", lets instead copy the "data" attribute and add another entry
  // to the bottom of the array if there isn't already a "src" specified.
  PRInt16 numRealAttrs = mNumCachedAttrs;
  nsAutoString data;
  nsIAtom *tag = content->Tag();
  if (nsHTMLAtoms::object == tag
    && !content->HasAttr(kNameSpaceID_None, nsHTMLAtoms::src)
    && NS_CONTENT_ATTR_NOT_THERE != content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::data, data)) {
      mNumCachedAttrs++;
  }

  // now lets make the arrays
  mCachedAttrParamNames  = (char **)PR_Calloc(sizeof(char *) * (mNumCachedAttrs + 1 + mNumCachedParams), 1);
  NS_ENSURE_TRUE(mCachedAttrParamNames,  NS_ERROR_OUT_OF_MEMORY);
  mCachedAttrParamValues = (char **)PR_Calloc(sizeof(char *) * (mNumCachedAttrs + 1 + mNumCachedParams), 1);
  NS_ENSURE_TRUE(mCachedAttrParamValues, NS_ERROR_OUT_OF_MEMORY);

  // let's fill in our attributes
  PRInt16 c = 0;

  // Some plugins (eg Flash, see bug 234675.) are actually sensitive to the
  // attribute order.  So we want to make sure we give the plugin the
  // attributes in the order they came in in the source, to be compatible with
  // other browsers.  Now in HTML, the storage order is the reverse of the
  // source order, while in XML and XHTML it's the same as the source order
  // (see the AddAttributes functions in the HTML and XML content sinks).
  PRInt16 start, end, increment;
  if (content->IsContentOfType(nsIContent::eHTML) &&
      content->GetNodeInfo()->NamespaceEquals(kNameSpaceID_None)) {
    // HTML.  Walk attributes in reverse order.
    start = numRealAttrs - 1;
    end = -1;
    increment = -1;
  } else {
    // XHTML or XML.  Walk attributes in forward order.
    start = 0;
    end = numRealAttrs;
    increment = 1;
  }
  for (PRInt16 index = start; index != end; index += increment) {
    PRInt32 nameSpaceID;
    nsCOMPtr<nsIAtom> atom;
    nsCOMPtr<nsIAtom> prefix;
    content->GetAttrNameAt(index, &nameSpaceID,
                           getter_AddRefs(atom),
                           getter_AddRefs(prefix));
    nsAutoString value;
    if (NS_CONTENT_ATTR_NOT_THERE != content->GetAttr(nameSpaceID, atom, value)) {
      nsAutoString name;
      atom->ToString(name);
      
      mOwner->FixUpURLS(name, value);

      mCachedAttrParamNames [c] = ToNewUTF8String(name);
      mCachedAttrParamValues[c] = ToNewUTF8String(value);
      c++;
    }
  }

  // if the conditions above were met, copy the "data" attribute to a "src" array entry
  if (data.Length()) {
    mCachedAttrParamNames [mNumCachedAttrs-1] = ToNewUTF8String(NS_LITERAL_STRING("SRC"));
    mCachedAttrParamValues[mNumCachedAttrs-1] = ToNewUTF8String(data);
  }

  // add our PARAM and null separator
  mCachedAttrParamNames [mNumCachedAttrs] = ToNewUTF8String(NS_LITERAL_STRING("PARAM"));
  mCachedAttrParamValues[mNumCachedAttrs] = nsnull;

  // now fill in the PARAM name/value pairs from the cached DOM nodes
  c = 0;
  for (PRInt16 idx = 0; idx < mNumCachedParams; idx++) {
    nsCOMPtr<nsIDOMElement> param = do_QueryElementAt(ourParams, idx);
    if (param) {
     nsAutoString name;
     nsAutoString value;
     param->GetAttribute(NS_LITERAL_STRING("name"), name); // check for empty done above
     param->GetAttribute(NS_LITERAL_STRING("value"), value);

     mOwner->FixUpURLS(name, value);

     /*
      * According to the HTML 4.01 spec, at
      * http://www.w3.org/TR/html4/types.html#type-cdata
      * ''User agents may ignore leading and trailing
      * white space in CDATA attribute values (e.g., "
      * myval " may be interpreted as "myval"). Authors
      * should not declare attribute values with
      * leading or trailing white space.''
      * However, do not trim consecutive spaces as in bug 122119
      */            
     name.Trim(" \n\r\t\b", PR_TRUE, PR_TRUE, PR_FALSE);
     value.Trim(" \n\r\t\b", PR_TRUE, PR_TRUE, PR_FALSE);
     mCachedAttrParamNames [mNumCachedAttrs + 1 + c] = ToNewUTF8String(name);
     mCachedAttrParamValues[mNumCachedAttrs + 1 + c] = ToNewUTF8String(value);
     c++;                                                      // rules!
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Processes a focus event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFocusListener.

Definition at line 3508 of file nsObjectFrame.cpp.

{
  mContentFocused = PR_TRUE;
  return DispatchFocusToPlugin(aFocusEvent);
}

Here is the call graph for this function:

Force a redraw.

Definition at line 2632 of file nsObjectFrame.cpp.

{
  nsIView* view = mOwner->GetView();
  if (view) {
    return view->GetViewManager()->Composite();
  }

  return NS_OK;
}

Here is the call graph for this function:

Get object alignment.

Definition at line 2962 of file nsObjectFrame.cpp.

{
  return GetAttribute("ALIGN", result);
}

Here is the call graph for this function:

void nsIPluginTagInfo::getAttribute ( in string  aName,
out constCharPtr  aResult 
) [inherited]

Gets the value for the named attribute.

Parameters:
aName- the name of the attribute to find
aResult- the resulting attribute
Returns:
- NS_OK if this operation was successful, NS_ERROR_FAILURE if this operation failed. result is set to NULL if the attribute is not found else to the found value.
NS_IMETHODIMP nsPluginInstanceOwner::GetAttribute ( const char *  name,
const char **  result 
)

Definition at line 2433 of file nsObjectFrame.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QueryInterface on nsIPluginInstancePeer to get this.

(Corresponds to NPP_New's argc, argn, and argv arguments.) Get a ptr to the paired list of attribute names and values, returns the length of the array.

Each name or value is a null-terminated string.

NS_IMETHODIMP nsPluginInstanceOwner::GetAttributes ( PRUint16 n,
const char *const *&  names,
const char *const *&  values 
)

Definition at line 2419 of file nsObjectFrame.cpp.

{
  nsresult rv = EnsureCachedAttrParamArrays();
  NS_ENSURE_SUCCESS(rv, rv);

  n = mNumCachedAttrs;
  names  = (const char **)mCachedAttrParamNames;
  values = (const char **)mCachedAttrParamValues;

  return rv;
}

Here is the call graph for this function:

Definition at line 3009 of file nsObjectFrame.cpp.

{
  nsresult    rv;
  const char  *hspace;

  rv = GetAttribute("HSPACE", &hspace);

  if (NS_OK == rv) {
    if (*result != 0)
      *result = (PRUint32)atol(hspace);
    else
      *result = 0;
  }
  else
    *result = 0;

  return rv;
}

Here is the call graph for this function:

Definition at line 2990 of file nsObjectFrame.cpp.

{
  nsresult    rv;
  const char  *vspace;

  rv = GetAttribute("VSPACE", &vspace);

  if (NS_OK == rv) {
    if (*result != 0)
      *result = (PRUint32)atol(vspace);
    else
      *result = 0;
  }
  else
    *result = 0;

  return rv;
}

Here is the call graph for this function:

Definition at line 2588 of file nsObjectFrame.cpp.

{
  if (!aDocument)
    return NS_ERROR_NULL_POINTER;

  *aDocument = nsnull;
  if (nsnull != mContext) {
    nsIPresShell *shell = mContext->GetPresShell();
    if (shell)
      NS_IF_ADDREF(*aDocument = shell->GetDocument());
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIPluginTagInfo2::getDocumentBase ( out constCharPtr  aDocumentBase) [inherited]

Get the document base.

Definition at line 2837 of file nsObjectFrame.cpp.

Here is the call graph for this function:

void nsIPluginTagInfo2::getDocumentEncoding ( out constCharPtr  aDocumentEncoding) [inherited]

Return an encoding whose name is specified in: http://java.sun.com/products/jdk/1.1/docs/guide/intl/intl.doc.html#25303.

Definition at line 2919 of file nsObjectFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(result);
  *result = nsnull;

  nsresult rv;
  nsCOMPtr<nsIDocument> doc;
  rv = GetDocument(getter_AddRefs(doc));
  NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get document");
  if (NS_FAILED(rv))
    return rv;

  const nsACString &charset = doc->GetDocumentCharacterSet();

  if (charset.IsEmpty())
    return NS_OK;

  // common charsets and those not requiring conversion first
  if (charset.EqualsLiteral("us-ascii")) {
    *result = PL_strdup("US_ASCII");
  } else if (charset.EqualsLiteral("ISO-8859-1") ||
      !nsCRT::strncmp(PromiseFlatCString(charset).get(), "UTF", 3)) {
    *result = ToNewCString(charset);
  } else {
    if (!gCharsetMap) {
      gCharsetMap = new nsHashtable(sizeof(charsets)/sizeof(moz2javaCharset));
      if (!gCharsetMap)
        return NS_ERROR_OUT_OF_MEMORY;

      for (PRUint16 i = 0; i < sizeof(charsets)/sizeof(moz2javaCharset); i++) {
        nsCStringKey key(charsets[i].mozName);
        gCharsetMap->Put(&key, (void *)(charsets[i].javaName));
      }
    }
    nsCStringKey mozKey(charset);
    // if found mapping, return it; otherwise return original charset
    char *mapping = (char *)gCharsetMap->Get(&mozKey);
    *result = mapping ? PL_strdup(mapping) : ToNewCString(charset);
  }

  return (*result) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}

Here is the call graph for this function:

Definition at line 2453 of file nsObjectFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(result);
  nsresult rv = NS_ERROR_FAILURE;

  *result = nsnull;

  if (nsnull != mOwner) {
    nsIContent* cont = mOwner->GetContent();
    if (cont) {
      rv = cont->QueryInterface(NS_GET_IID(nsIDOMElement), (void **)result);
    }
  }

  return rv;
}

Get the instance associated with this owner.

Definition at line 2470 of file nsObjectFrame.cpp.

{
  NS_IF_ADDREF(aInstance = mInstance);

  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 2404 of file nsObjectFrame.cpp.

Here is the call graph for this function:

void nsIPluginTagInfo2::getParameter ( in string  aName,
out constCharPtr  aResult 
) [inherited]

Get the value for the named parameter.

Returns null if the parameter was not set.

Parameters:
aName- name of the parameter
aResult- parameter value
Returns:
- NS_OK if this operation was successful
NS_IMETHODIMP nsPluginInstanceOwner::GetParameter ( const char *  name,
const char **  result 
)

Definition at line 2817 of file nsObjectFrame.cpp.

Here is the call graph for this function:

Get a ptr to the paired list of parameter names and values, returns the length of the array.

Each name or value is a null-terminated string.

NS_IMETHODIMP nsPluginInstanceOwner::GetParameters ( PRUint16 n,
const char *const *&  names,
const char *const *&  values 
)

Definition at line 2802 of file nsObjectFrame.cpp.

{
  nsresult rv = EnsureCachedAttrParamArrays();
  NS_ENSURE_SUCCESS(rv, rv);

  n = mNumCachedParams;
  if (n) {
    names  = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
    values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
  } else
    names = values = nsnull;

  return rv;
}

Here is the call graph for this function:

!! Port must be released for windowless plugins on Windows, because it is HDC !!!

Definition at line 4158 of file nsObjectFrame.cpp.

{

  nsPluginPort* result = NULL;
  if (mWidget) {
#ifdef XP_WIN
    if (mPluginWindow && mPluginWindow->type == nsPluginWindowType_Drawable)
      result = (nsPluginPort*) mWidget->GetNativeData(NS_NATIVE_GRAPHIC);
    else
#endif
      result = (nsPluginPort*) mWidget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
    }
    return result;
}

Here is the caller graph for this function:

Get the complete text of the HTML tag that was used to instantiate this plugin.

Definition at line 2759 of file nsObjectFrame.cpp.

{
    NS_ENSURE_ARG_POINTER(result);
    if (nsnull == mTagText) {
        nsresult rv;
        nsIContent* content = mOwner->GetContent();

        nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content, &rv));
        if (NS_FAILED(rv))
            return rv;
        nsCOMPtr<nsIDocument> document;
        rv = GetDocument(getter_AddRefs(document));
        if (NS_FAILED(rv))
            return rv;
        nsCOMPtr<nsIDocumentEncoder> docEncoder(do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE "text/html", &rv));
        if (NS_FAILED(rv))
            return rv;
        rv = docEncoder->Init(document, NS_LITERAL_STRING("text/html"), nsIDocumentEncoder::OutputEncodeBasicEntities);
        if (NS_FAILED(rv))
            return rv;

        nsCOMPtr<nsIDOMRange> range(do_CreateInstance(kRangeCID,&rv));
        if (NS_FAILED(rv))
            return rv;

        rv = range->SelectNode(node);
        if (NS_FAILED(rv))
            return rv;

        docEncoder->SetRange(range);
        nsString elementHTML;
        rv = docEncoder->EncodeToString(elementHTML);
        if (NS_FAILED(rv))
            return rv;

        mTagText = ToNewUTF8String(elementHTML);
        if (!mTagText)
            return NS_ERROR_OUT_OF_MEMORY;
    }
    *result = mTagText;
    return NS_OK;
}

Here is the call graph for this function:

Definition at line 2733 of file nsObjectFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(result);
  nsresult rv = NS_ERROR_FAILURE;

  *result = nsPluginTagType_Unknown;

  if (mOwner) {
    nsIContent* cont = mOwner->GetContent();
    if (cont) {
      nsIAtom *atom = cont->Tag();

      if (atom == nsHTMLAtoms::applet)
        *result = nsPluginTagType_Applet;
      else if (atom == nsHTMLAtoms::embed)
        *result = nsPluginTagType_Embed;
      else if (atom == nsHTMLAtoms::object)
        *result = nsPluginTagType_Object;

      rv = NS_OK;
    }
  }

  return rv;
}

Here is the call graph for this function:

Definition at line 3028 of file nsObjectFrame.cpp.

NS_IMETHODIMP nsPluginInstanceOwner::GetURL ( const char *  aURL,
const char *  aTarget,
void aPostData,
PRUint32  aPostDataLen,
void aHeadersData,
PRUint32  aHeadersDataLen,
PRBool  aIsFile = PR_FALSE 
) [virtual]

Called when there is a valid target so that the proper frame can be updated with new content.

will not be called with nsnull aTarget.

Implements nsIPluginInstanceOwner.

Definition at line 2477 of file nsObjectFrame.cpp.

{
  NS_ENSURE_TRUE(mOwner,NS_ERROR_NULL_POINTER);
  NS_ENSURE_TRUE(mContext,NS_ERROR_NULL_POINTER);

  // the container of the pres context will give us the link handler
  nsCOMPtr<nsISupports> container = mContext->GetContainer();
  NS_ENSURE_TRUE(container,NS_ERROR_FAILURE);
  nsCOMPtr<nsILinkHandler> lh = do_QueryInterface(container);
  NS_ENSURE_TRUE(lh, NS_ERROR_FAILURE);

  nsAutoString  unitarget; unitarget.AssignASCII(aTarget); // XXX could this be nonascii?

  nsCOMPtr<nsIURI> baseURL;
  nsCOMPtr<nsIDocument> doc;
  nsresult rv = GetDocument(getter_AddRefs(doc));
  if (NS_SUCCEEDED(rv) && doc) {
    // XXX should this really be the document base URL?  Or the
    // content's base URL?
    baseURL = doc->GetBaseURI();  // gets the document's url
  } else {
    baseURL = mOwner->GetFullURL(); // gets the plugin's content url
  }

  // Create an absolute URL
  nsCOMPtr<nsIURI> uri;
  rv = NS_NewURI(getter_AddRefs(uri), aURL, baseURL);

  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
  nsIContent* content = mOwner->GetContent();
  NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);

  nsCOMPtr<nsIInputStream> postDataStream;
  nsCOMPtr<nsIInputStream> headersDataStream;

  // deal with post data, either in a file or raw data, and any headers
  if (aPostData) {

    rv = NS_NewPluginPostDataStream(getter_AddRefs(postDataStream), (const char *)aPostData, aPostDataLen, isFile);

    NS_ASSERTION(NS_SUCCEEDED(rv),"failed in creating plugin post data stream");
    if (NS_FAILED(rv))
      return rv;

    if (aHeadersData) {
      rv = NS_NewPluginPostDataStream(getter_AddRefs(headersDataStream), 
                                      (const char *) aHeadersData, 
                                      aHeadersDataLen,
                                      PR_FALSE,
                                      PR_TRUE);  // last arg says we are headers, no /r/n/r/n fixup!

      NS_ASSERTION(NS_SUCCEEDED(rv),"failed in creating plugin header data stream");
      if (NS_FAILED(rv))
        return rv;
    }
  }

  PRInt32 blockPopups =
    nsContentUtils::GetIntPref("privacy.popups.disable_from_plugins");
  nsAutoPopupStatePusher popupStatePusher((PopupControlState)blockPopups);

  rv = lh->OnLinkClick(content, eLinkVerb_Replace, 
                       uri, unitarget.get(), 
                       postDataStream, headersDataStream);

  return rv;
}

Here is the call graph for this function:

void nsIPluginInstanceOwner::getValue ( in nsPluginInstancePeerVariable  aVariable,
in voidPtr  aValue 
) [inherited]

Get the specified variable.

Definition at line 2642 of file nsObjectFrame.cpp.

{
  nsresult rv = NS_ERROR_FAILURE;

  switch(variable) {
    case nsPluginInstancePeerVariable_NetscapeWindow:
    {      
      // get the document's widget from the view manager
      // get the view manager from the pres shell, not from the view!
      // we may not have a view if we are hidden
      if (mContext) {
        void** pvalue = (void**)value;
        nsIViewManager* vm = mContext->GetViewManager();
        if (vm) {
#if defined(XP_WIN)
          // This property is provided to allow a "windowless" plugin to determine the window it is drawing
          // in, so it can translate mouse coordinates it receives directly from the operating system
          // to coordinates relative to itself.
          
          // The original code (outside this #if) returns the document's window, which is OK if the window the "windowless" plugin
          // is drawing into has the same origin as the document's window, but this is not the case for "windowless" plugins inside of scrolling DIVs etc
   
          // To make sure "windowless" plugins always get the right origin for translating mouse coordinates, this code
          // determines the window handle of the mozilla window containing the "windowless" plugin.
   
          // Given that this HWND may not be that of the document's window, there is a slight risk
          // of confusing a plugin that is using this HWND for illicit purposes, but since the documentation
          // does not suggest this HWND IS that of the document window, rather that of the window
          // the plugin is drawn in, this seems like a safe fix.
           
          // we only attempt to get the nearest window if this really is a "windowless" plugin so as not
          // to change any behaviour for the much more common windowed plugins,
          // though why this method would even be being called for a windowed plugin escapes me.
          if (mPluginWindow && mPluginWindow->type == nsPluginWindowType_Drawable) {
            if (mOwner) {
              // it turns out that flash also uses this window for determining focus, and is currently
              // unable to show a caret correctly if we return the enclosing window. Therefore for
              // now we only return the enclosing window when there is an actual offset which
              // would otherwise cause coordinates to be offset incorrectly. (i.e.
              // if the enclosing window if offset from the document window)
              //
              // fixing both the caret and ability to interact issues for a windowless control in a non document aligned windw
              // does not seem to be possible without a change to the flash plugin
    
              nsIWidget* win = mOwner->GetWindow();
              if (win) {
                nsIView *view = nsIView::GetViewFor(win);
                NS_ASSERTION(view, "No view for widget");
                nsIView *rootView = nsnull;
                vm->GetRootView(rootView);
                NS_ASSERTION(rootView, "No root view");
                nsPoint offset = view->GetOffsetTo(rootView);
      
                if (offset.x || offset.y) {
                  // in the case the two windows are offset from eachother, we do go ahead and return the correct enclosing window
                  // so that mouse co-ordinates are not messed up.
                  *pvalue = (void*)win->GetNativeData(NS_NATIVE_WINDOW);
                  if (*pvalue) {
                    return NS_OK;
                  }
                }
              }
            }
          }
#endif
          // simply return the document window
          nsCOMPtr<nsIWidget> widget;
          rv = vm->GetWidget(getter_AddRefs(widget));            
          if (widget) {
            *pvalue = (void*)widget->GetNativeData(NS_NATIVE_WINDOW);
          } else NS_ASSERTION(widget, "couldn't get doc's widget in getting doc's window handle");
        } else NS_ASSERTION(vm, "couldn't get view manager in getting doc's window handle");
      } else NS_ASSERTION(mContext, "plugin owner has no pres context in getting doc's window handle");

      break;
    }
  }

  return rv;
}

Here is the call graph for this function:

Get a handle to the window structure of the owner.

This pointer cannot be made persistant by the caller.

Definition at line 2397 of file nsObjectFrame.cpp.

{
  NS_ASSERTION(mPluginWindow, "the plugin window object being returned is null");
  aWindow = mPluginWindow;
  return NS_OK;
}

Here is the caller graph for this function:

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Parameters:
evtThe Event contains contextual information about the event. It also contains the stopPropagation and preventDefault methods which are used in determining the event's flow and default action.

Definition at line 3835 of file nsObjectFrame.cpp.

{
  return NS_OK;
}

Definition at line 4093 of file nsObjectFrame.cpp.

{
  //do not addref to avoid circular refs. MMP
  mContext = aPresContext;
  mOwner = aFrame;
  
  nsIContent* content = mOwner->GetContent();
  
  // Some plugins require a specific sequence of shutdown and startup when
  // a page is reloaded. Shutdown happens usually when the last instance
  // is destroyed. Here we make sure the plugin instance in the old
  // document is destroyed before we try to create the new one.
  aPresContext->EnsureVisible(PR_TRUE);

  // register context menu listener
  mCXMenuListener = new nsPluginDOMContextMenuListener();
  if (mCXMenuListener) {    
    NS_ADDREF(mCXMenuListener);    
    mCXMenuListener->Init(aFrame);
  }

  nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content));
  if (receiver) {

    nsCOMPtr<nsIDOMEventListener> listener;
    QueryInterface(NS_GET_IID(nsIDOMEventListener), getter_AddRefs(listener));

    // Register focus listener
    receiver->AddEventListenerByIID(listener, NS_GET_IID(nsIDOMFocusListener));

    // Register mouse listener
    receiver->AddEventListenerByIID(listener, NS_GET_IID(nsIDOMMouseListener));

    // now do the mouse motion listener
    receiver->AddEventListenerByIID(listener, NS_GET_IID(nsIDOMMouseMotionListener));

    // Register key listener
    receiver->AddEventListener(NS_LITERAL_STRING("keypress"), listener, PR_TRUE);
    receiver->AddEventListener(NS_LITERAL_STRING("keydown"), listener, PR_TRUE);
    receiver->AddEventListener(NS_LITERAL_STRING("keyup"), listener, PR_TRUE);

    // Register drag listener
    receiver->AddEventListener(NS_LITERAL_STRING("dragdrop"), listener, PR_TRUE);
    receiver->AddEventListener(NS_LITERAL_STRING("dragover"), listener, PR_TRUE);
    receiver->AddEventListener(NS_LITERAL_STRING("dragexit"), listener, PR_TRUE);
    receiver->AddEventListener(NS_LITERAL_STRING("dragenter"), listener, PR_TRUE);
    receiver->AddEventListener(NS_LITERAL_STRING("draggesture"), listener, PR_TRUE);
  }
  
  // Register scroll position listener
  // We need to register a scroll pos listener on every scrollable
  // view up to the top
  nsIFrame* parentWithView = mOwner->GetAncestorWithView();
  nsIView* curView = parentWithView ? parentWithView->GetView() : nsnull;
  while (curView) {
    nsIScrollableView* scrollingView = curView->ToScrollableView();
    if (scrollingView)
      scrollingView->AddScrollPositionListener((nsIScrollPositionListener *)this);
    
    curView = curView->GetParent();
  }

  return NS_OK; 
}

Here is the call graph for this function:

Here is the caller graph for this function:

Invalidate the rectangle.

Definition at line 2602 of file nsObjectFrame.cpp.

{
  nsresult rv = NS_ERROR_FAILURE;

  if (invalidRect) {
    //no reference count on view
    nsIView* view = mOwner->GetView();

    if (view) {
      float ptot;
      ptot = mContext->PixelsToTwips();

      nsRect rect((int)(ptot * invalidRect->left),
            (int)(ptot * invalidRect->top),
            (int)(ptot * (invalidRect->right - invalidRect->left)),
            (int)(ptot * (invalidRect->bottom - invalidRect->top)));

      //set flags to not do a synchronous update, force update does the redraw
      view->GetViewManager()->UpdateView(view, rect, NS_VMREFRESH_NO_SYNC);
    }
  }

  return rv;
}

Here is the call graph for this function:

Invalidate the region.

Definition at line 2627 of file nsObjectFrame.cpp.

Processes a key pressed event.

Parameters:
aKeyEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMKeyListener.

Definition at line 3616 of file nsObjectFrame.cpp.

{
  return DispatchKeyToPlugin(aKeyEvent);
}

Here is the call graph for this function:

Processes a key typed event.

Parameters:
aKeyEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMKeyListener.

Definition at line 3626 of file nsObjectFrame.cpp.

{
#if defined(XP_MAC) || defined(XP_MACOSX) // send KeyPress events only on Mac

  // KeyPress events are really synthesized keyDown events.
  // Here we check the native message of the event so that
  // we won't send the plugin two keyDown events.
  nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aKeyEvent));
  if (privateEvent) {
    nsEvent *theEvent;
    privateEvent->GetInternalNSEvent(&theEvent);
    const nsGUIEvent *guiEvent = (nsGUIEvent*)theEvent;
    const EventRecord *ev = (EventRecord*)(guiEvent->nativeMsg); 
    if (guiEvent &&
        guiEvent->message == NS_KEY_PRESS &&
        ev &&
        ev->what == keyDown)
      return aKeyEvent->PreventDefault(); // consume event
  }

  // Nasty hack to avoid recursive event dispatching with Java. Java can
  // dispatch key events to a TSM handler, which comes back and calls 
  // [ChildView insertText:] on the cocoa widget, which sends a key
  // event back down.
  static PRBool sInKeyDispatch = PR_FALSE;
  
  if (sInKeyDispatch)
    return aKeyEvent->PreventDefault(); // consume event

  sInKeyDispatch = PR_TRUE;
  nsresult rv =  DispatchKeyToPlugin(aKeyEvent);
  sInKeyDispatch = PR_FALSE;
  return rv;
#else
  if (mInstance) {
    // If this event is going to the plugin, we want to kill it.
    // Not actually sending keypress to the plugin, since we didn't before.
    aKeyEvent->PreventDefault();
    aKeyEvent->StopPropagation();
  }
  return NS_OK;
#endif
}

Here is the call graph for this function:

Processes a key release event.

Parameters:
aKeyEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMKeyListener.

Definition at line 3621 of file nsObjectFrame.cpp.

{
  return DispatchKeyToPlugin(aKeyEvent);
}

Here is the call graph for this function:

Processes a mouse click event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 3773 of file nsObjectFrame.cpp.

{
  if (mOwner->IsBroken()) {
    FirePluginNotFoundEvent(mOwner->GetContent());

    aMouseEvent->PreventDefault();

    return NS_OK;
  }

  return DispatchMouseToPlugin(aMouseEvent);
}

Here is the call graph for this function:

Processes a mouse click event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 3787 of file nsObjectFrame.cpp.

{
  return DispatchMouseToPlugin(aMouseEvent);
}

Here is the call graph for this function:

nsIDOMMouseListener interfaces

See also:
nsIDOMMouseListener

Implements nsIDOMMouseListener.

Definition at line 3733 of file nsObjectFrame.cpp.

{
#if !(defined(XP_MAC) || defined(XP_MACOSX))
  if (!mPluginWindow || nsPluginWindowType_Window == mPluginWindow->type)
    return aMouseEvent->PreventDefault(); // consume event
  // continue only for cases without child window
#endif

  // if the plugin is windowless, we need to set focus ourselves
  // otherwise, we might not get key events
  if (mPluginWindow && mPluginWindow->type == nsPluginWindowType_Drawable) {
    nsIContent* content = mOwner->GetContent();
    if (content)
      content->SetFocus(mContext);
  }

  nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
  if (privateEvent) {
    nsMouseEvent* mouseEvent = nsnull;
    privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
    if (mouseEvent) {
      nsEventStatus rv = ProcessEvent(*mouseEvent);
      if (nsEventStatus_eConsumeNoDefault == rv) {
        return aMouseEvent->PreventDefault(); // consume event
      }
    }
    else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseDown failed, mouseEvent null");   
  }
  else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseDown failed, privateEvent null");   
  
  return NS_OK;
}

Here is the call graph for this function:

Processes a mouse move event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseMotionListener.

Definition at line 3701 of file nsObjectFrame.cpp.

{
#if !(defined(XP_MAC) || defined(XP_MACOSX))
  if (!mPluginWindow || nsPluginWindowType_Window == mPluginWindow->type)
    return aMouseEvent->PreventDefault(); // consume event
  // continue only for cases without child window
#endif

  // don't send mouse events if we are hiddden
  if (!mWidgetVisible)
    return NS_OK;

  nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
  if (privateEvent) {
    nsMouseEvent* mouseEvent = nsnull;
    privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
    if (mouseEvent) {
      nsEventStatus rv = ProcessEvent(*mouseEvent);
      if (nsEventStatus_eConsumeNoDefault == rv) {
        return aMouseEvent->PreventDefault(); // consume event
      }
    }
    else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseMove failed, mouseEvent null");   
  }
  else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseMove failed, privateEvent null");   
  
  return NS_OK;
}

Here is the call graph for this function:

Processes a mouse leave event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 3799 of file nsObjectFrame.cpp.

{
  return DispatchMouseToPlugin(aMouseEvent);
}

Here is the call graph for this function:

Processes a mouse enter event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 3793 of file nsObjectFrame.cpp.

{
  return DispatchMouseToPlugin(aMouseEvent);
}

Here is the call graph for this function:

nsresult nsPluginInstanceOwner::MouseUp ( nsIDOMEvent aMouseEvent) [virtual]

Processes a mouse up event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 3767 of file nsObjectFrame.cpp.

{
  return DispatchMouseToPlugin(aMouseEvent);
}

Here is the call graph for this function:

void nsITimerCallback::notify ( in nsITimer  timer) [inherited]
Parameters:
aTimerthe timer which has expired
void nsPluginInstanceOwner::Paint ( const nsRect aDirtyRect,
PRUint32  ndc = 0 
)

Definition at line 3972 of file nsObjectFrame.cpp.

{
  if (!mInstance)
    return;
 
#if defined(XP_MACOSX)
#ifdef DO_DIRTY_INTERSECT   // aDirtyRect isn't always correct, see bug 56128
  nsPoint rel(aDirtyRect.x, aDirtyRect.y);
  nsPoint abs(0,0);
  nsCOMPtr<nsIWidget> containerWidget;

  // Convert dirty rect relative coordinates to absolute and also get the containerWidget
  ConvertRelativeToWindowAbsolute(mOwner, rel, abs, *getter_AddRefs(containerWidget));

  nsRect absDirtyRect = nsRect(abs.x, abs.y, aDirtyRect.width, aDirtyRect.height);

  // Convert to absolute pixel values for the dirty rect
  nsRect absDirtyRectInPixels;
  ConvertTwipsToPixels(*mContext, absDirtyRect, absDirtyRectInPixels);
#endif

  nsCOMPtr<nsIPluginWidget> pluginWidget = do_QueryInterface(mWidget);
  if (pluginWidget && NS_SUCCEEDED(pluginWidget->StartDrawPlugin())) {
    nsPluginPort* pluginPort = FixUpPluginWindow(ePluginPaintEnable);
    if (pluginPort) {
      WindowRef  nativeWindowRef = ::GetWindowFromPort(pluginPort->port);
      
      EventRecord updateEvent;
      InitializeEventRecord(&updateEvent);
      updateEvent.what = updateEvt;
      updateEvent.message = UInt32(nativeWindowRef);
    
      nsPluginEvent pluginEvent = { &updateEvent, nsPluginPlatformWindowRef(nativeWindowRef) };
      PRBool eventHandled = PR_FALSE;
      mInstance->HandleEvent(&pluginEvent, &eventHandled);
    }
    pluginWidget->EndDrawPlugin();
  }
#endif

#ifdef XP_WIN
  nsPluginWindow * window;
  GetWindow(window);
  nsRect relDirtyRect = nsRect(aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);
  nsRect relDirtyRectInPixels;
  ConvertTwipsToPixels(*mContext, relDirtyRect, relDirtyRectInPixels);

  // we got dirty rectangle in relative window coordinates, but we
  // need it in absolute units and in the (left, top, right, bottom) form
  RECT drc;
  drc.left   = relDirtyRectInPixels.x + window->x;
  drc.top    = relDirtyRectInPixels.y + window->y;
  drc.right  = drc.left + relDirtyRectInPixels.width;
  drc.bottom = drc.top + relDirtyRectInPixels.height;

  nsPluginEvent pluginEvent;
  pluginEvent.event = 0x000F; 
  pluginEvent.wParam = (uint32)ndc;
  pluginEvent.lParam = (uint32)&drc;
  PRBool eventHandled = PR_FALSE;
  mInstance->HandleEvent(&pluginEvent, &eventHandled);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Inform the owner that no plugin for the given mime type was found.

Definition at line 2724 of file nsObjectFrame.cpp.

{
  if (mOwner) {
    mOwner->PluginNotAvailable(aMimeType);
  }

  return NS_OK;
}

Here is the call graph for this function:

Processes all events.

If a mouse listener is registered this method will not process mouse events.

Parameters:
anEventthe event to process. See nsGUIEvent.h for event types.

Implements nsIEventListener.

Definition at line 3841 of file nsObjectFrame.cpp.

{
  // printf("nsGUIEvent.message: %d\n", anEvent.message);
  nsEventStatus rv = nsEventStatus_eIgnore;
  if (!mInstance)   // if mInstance is null, we shouldn't be here
    return rv;

#if defined(XP_MAC) || defined(XP_MACOSX)
  // check for null mWidget
  if (mWidget) {
    nsCOMPtr<nsIPluginWidget> pluginWidget = do_QueryInterface(mWidget);
    if (pluginWidget && NS_SUCCEEDED(pluginWidget->StartDrawPlugin())) {
      EventRecord macEvent;
      EventRecord* event = (EventRecord*)anEvent.nativeMsg;
      if ((event == NULL) || (event->what == nullEvent)  || 
          (anEvent.message == NS_FOCUS_EVENT_START)      || 
          (anEvent.message == NS_BLUR_CONTENT)           || 
          (anEvent.message == NS_MOUSE_MOVE)             ||
          (anEvent.message == NS_MOUSE_ENTER)) {
        GUItoMacEvent(anEvent, event, macEvent);
        event = &macEvent;
      }

#ifdef MOZ_WIDGET_COCOA
      if (anEvent.message == NS_FOCUS_CONTENT)
      {
        // Work around an issue in the Flash plugin, which can cache a pointer
        // to a doomed TSM document (one that belongs to a NSTSMInputContext)
        // and try to activate it after it has been deleted. See bug 183313.
        ::DeactivateTSMDocument(::TSMGetActiveDocument());
      }
#endif
      
      nsPluginPort* pluginPort = FixUpPluginWindow(ePluginPaintIgnore);
      PRBool eventHandled = PR_FALSE;
      if (pluginPort) {
        nsPluginEvent pluginEvent =
          {
            event,
            nsPluginPlatformWindowRef(GetWindowFromPort(pluginPort->port))
          };

        mInstance->HandleEvent(&pluginEvent, &eventHandled);
      }

      if (eventHandled && !(anEvent.message == NS_MOUSE_LEFT_BUTTON_DOWN &&
                            !mContentFocused))
        rv = nsEventStatus_eConsumeNoDefault;

      pluginWidget->EndDrawPlugin();
    }
  }
#endif

#ifdef XP_WIN
  // this code supports windowless plugins
  nsPluginEvent * pPluginEvent = (nsPluginEvent *)anEvent.nativeMsg;
  // we can get synthetic events from the nsEventStateManager... these
  // have no nativeMsg

  if (pPluginEvent) {
    PRBool eventHandled = PR_FALSE;
    mInstance->HandleEvent(pPluginEvent, &eventHandled);
    if (eventHandled)
      rv = nsEventStatus_eConsumeNoDefault;
  }
#endif

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsPluginInstanceOwner::ReleasePluginPort ( nsPluginPort *  pluginPort)

Definition at line 4174 of file nsObjectFrame.cpp.

{
#ifdef XP_WIN
  if (mWidget && mPluginWindow &&
      mPluginWindow->type == nsPluginWindowType_Drawable) {
    mWidget->FreeNativeData((HDC)pluginPort, NS_NATIVE_GRAPHIC);
  }
#endif
}

Here is the caller graph for this function:

Implements nsIScrollPositionListener.

Definition at line 3473 of file nsObjectFrame.cpp.

{
#if defined(XP_MACOSX)
    if (mInstance) {
      nsCOMPtr<nsIPluginWidget> pluginWidget = do_QueryInterface(mWidget);
      if (pluginWidget && NS_SUCCEEDED(pluginWidget->StartDrawPlugin())) {
        EventRecord scrollEvent;
        InitializeEventRecord(&scrollEvent);
        scrollEvent.what = nsPluginEventType_ScrollingEndsEvent;
  
        nsPluginPort* pluginPort = FixUpPluginWindow(ePluginPaintEnable);
        if (pluginPort) {
          nsPluginEvent pluginEvent =
            { &scrollEvent,
              nsPluginPlatformWindowRef(GetWindowFromPort(pluginPort->port))
            };

          PRBool eventHandled = PR_FALSE;
          mInstance->HandleEvent(&pluginEvent, &eventHandled);
        }
        pluginWidget->EndDrawPlugin();
      }

      // FIXME - Only invalidate the newly revealed amount.
      // XXX necessary?
      if (mWidget)
        mWidget->Invalidate(PR_TRUE);
    }
#endif

    StartTimer();
    return NS_OK;
}

Here is the call graph for this function:

Implements nsIScrollPositionListener.

Definition at line 3447 of file nsObjectFrame.cpp.

{
#if defined(XP_MAC) || defined(XP_MACOSX)
    CancelTimer();

    if (mInstance) {
        nsCOMPtr<nsIPluginWidget> pluginWidget = do_QueryInterface(mWidget);
        if (pluginWidget && NS_SUCCEEDED(pluginWidget->StartDrawPlugin())) {
            EventRecord scrollEvent;
            InitializeEventRecord(&scrollEvent);
            scrollEvent.what = nsPluginEventType_ScrollingBeginsEvent;
    
            nsPluginPort* pluginPort = FixUpPluginWindow(ePluginPaintDisable);
            if (pluginPort) {
              nsPluginEvent pluginEvent = { &scrollEvent, nsPluginPlatformWindowRef(GetWindowFromPort(pluginPort->port)) };
            
              PRBool eventHandled = PR_FALSE;
              mInstance->HandleEvent(&pluginEvent, &eventHandled);
            }
            pluginWidget->EndDrawPlugin();
        }
    }
#endif
    return NS_OK;
}

Here is the call graph for this function:

Let the owner know that an instance has been created.

Definition at line 2390 of file nsObjectFrame.cpp.

{
  mInstance = aInstance;

  return NS_OK;
}

Definition at line 4250 of file nsObjectFrame.cpp.

{
  mPluginHost = aHost;
}

Here is the caller graph for this function:

void nsIPluginInstanceOwner::showStatus ( in string  aStatusMsg) [inherited]

Show a status message in the host environment.

Definition at line 2546 of file nsObjectFrame.cpp.

{
  nsresult  rv = NS_ERROR_FAILURE;
  
  rv = this->ShowStatus(NS_ConvertUTF8toUCS2(aStatusMsg).get());
  
  return rv;
}

Implements nsIPluginInstanceOwner.

Definition at line 2555 of file nsObjectFrame.cpp.

{
  nsresult  rv = NS_ERROR_FAILURE;

  if (!mContext) {
    return rv;
  }
  nsCOMPtr<nsISupports> cont = mContext->GetContainer();
  if (!cont) {
    return NS_OK;
  }

  nsCOMPtr<nsIDocShellTreeItem> docShellItem(do_QueryInterface(cont, &rv));
  if (NS_FAILED(rv) || !docShellItem) {
    return rv;
  }

  nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
  rv = docShellItem->GetTreeOwner(getter_AddRefs(treeOwner));
  if (NS_FAILED(rv) || !treeOwner) {
    return rv;
  }

  nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(treeOwner, &rv));
  if (NS_FAILED(rv) || !browserChrome) {
    return rv;
  }
  rv = browserChrome->SetStatus(nsIWebBrowserChrome::STATUS_SCRIPT, 
                                aStatusMsg);

  return rv;
}

Here is the call graph for this function:

Definition at line 4071 of file nsObjectFrame.cpp.

{
#if defined(XP_MAC) || defined(XP_MACOSX)
    nsresult rv;

    // start a periodic timer to provide null events to the plugin instance.
    if (!mPluginTimer) {
      mPluginTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
      if (NS_SUCCEEDED(rv))
        rv = mPluginTimer->InitWithCallback(this, 1020 / 60, nsITimer::TYPE_REPEATING_SLACK);
    }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

readonly attribute unsigned long nsIPluginTagInfo2::borderHorizSpace [inherited]

Get border horizontal space.

Definition at line 129 of file nsIPluginTagInfo2.idl.

readonly attribute unsigned long nsIPluginTagInfo2::borderVertSpace [inherited]

Get border vertical space.

Definition at line 124 of file nsIPluginTagInfo2.idl.

Get the associated document.

Definition at line 110 of file nsIPluginInstanceOwner.idl.

Returns the DOM element corresponding to the tag which references this plugin in the document.

Parameters:
aDOMElement- resulting DOM element
Returns:
- NS_OK if this operation was successful

Definition at line 143 of file nsIPluginTagInfo2.idl.

readonly attribute unsigned long nsIPluginTagInfo2::height [inherited]

Get object height.

Definition at line 119 of file nsIPluginTagInfo2.idl.

Definition at line 393 of file nsObjectFrame.cpp.

Definition at line 394 of file nsObjectFrame.cpp.

Definition at line 389 of file nsObjectFrame.cpp.

Definition at line 386 of file nsObjectFrame.cpp.

Definition at line 396 of file nsObjectFrame.cpp.

Definition at line 383 of file nsObjectFrame.cpp.

Definition at line 404 of file nsObjectFrame.cpp.

Definition at line 381 of file nsObjectFrame.cpp.

Definition at line 391 of file nsObjectFrame.cpp.

Definition at line 392 of file nsObjectFrame.cpp.

Get the display mode for the plugin instance.

Definition at line 73 of file nsIPluginInstanceOwner.idl.

Definition at line 382 of file nsObjectFrame.cpp.

Definition at line 388 of file nsObjectFrame.cpp.

Definition at line 387 of file nsObjectFrame.cpp.

Definition at line 380 of file nsObjectFrame.cpp.

Definition at line 384 of file nsObjectFrame.cpp.

Definition at line 385 of file nsObjectFrame.cpp.

Definition at line 390 of file nsObjectFrame.cpp.

Get the type of the HTML tag that was used ot instantiate this plugin.

Currently supported tags are EMBED, OBJECT and APPLET.

Definition at line 68 of file nsIPluginTagInfo2.idl.

readonly attribute unsigned long nsIPluginTagInfo2::uniqueID [inherited]

Returns a unique id for the current document containing plugin.

Definition at line 134 of file nsIPluginTagInfo2.idl.

readonly attribute unsigned long nsIPluginTagInfo2::width [inherited]

Get object width.

Definition at line 114 of file nsIPluginTagInfo2.idl.


The documentation for this class was generated from the following file: