Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
nsContentAreaDragDrop Class Reference

#include <nsContentAreaDragDrop.h>

Inheritance diagram for nsContentAreaDragDrop:
Inheritance graph
[legend]
Collaboration diagram for nsContentAreaDragDrop:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIDRAGDROPHANDLER
NS_DECL_NSIFLAVORDATAPROVIDER 
nsContentAreaDragDrop ()
virtual ~nsContentAreaDragDrop ()
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.
NS_IMETHOD HandleEvent (nsIDOMEvent *event)
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.
void hookupTo (in nsIDOMEventTarget attachPoint, in nsIWebNavigation navigator)
 Attach drag handlers to receiver specified by |attachPoint| and specify callbacks to allow overriding of the built-in behaviors.
void detach ()
 Unregister all handlers related to drag&drop.
void getFlavorData (in nsITransferable aTransferable, in string aFlavor, out nsISupports aData, out unsigned long aDataLen)
 Retrieve the data from this data provider.

Private Member Functions

nsresult AddDragListener ()
nsresult RemoveDragListener ()
nsresult CreateTransferable (nsIDOMEvent *inMouseEvent, nsITransferable **outTrans)
void ExtractURLFromData (const nsACString &inFlavor, nsISupports *inDataWrapper, PRUint32 inDataLen, nsAString &outURL)
nsresult GetHookEnumeratorFromEvent (nsIDOMEvent *inEvent, nsISimpleEnumerator **outEnumerator)

Static Private Member Functions

static void NormalizeSelection (nsIDOMNode *inBaseNode, nsISelection *inSelection)
static void GetEventDocument (nsIDOMEvent *inEvent, nsIDOMDocument **outDocument)
static nsresult SaveURIToFile (nsAString &inSourceURIString, nsIFile *inDestFile)

Private Attributes

PRPackedBool mListenerInstalled
nsCOMPtr< nsIDOMEventReceivermEventReceiver
nsIWebNavigationmNavigator

Detailed Description

Definition at line 78 of file nsContentAreaDragDrop.h.


Constructor & Destructor Documentation

Definition at line 179 of file nsContentAreaDragDrop.cpp.

Definition at line 188 of file nsContentAreaDragDrop.cpp.

{
  RemoveDragListener();

} // dtor

Here is the call graph for this function:


Member Function Documentation

Definition at line 222 of file nsContentAreaDragDrop.cpp.

{
  nsresult rv = NS_ERROR_FAILURE;

  if ( mEventReceiver ) {
    nsIDOMDragListener *pListener = NS_STATIC_CAST(nsIDOMDragListener *, this);
    rv = mEventReceiver->AddEventListenerByIID(pListener,
                                               NS_GET_IID(nsIDOMDragListener));
    if (NS_SUCCEEDED(rv))
      mListenerInstalled = PR_TRUE;
  }

  return rv;
}
nsresult nsContentAreaDragDrop::CreateTransferable ( nsIDOMEvent inMouseEvent,
nsITransferable **  outTrans 
) [private]

Definition at line 663 of file nsContentAreaDragDrop.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Unregister all handlers related to drag&drop.

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 471 of file nsContentAreaDragDrop.cpp.

{
  // if we don't have a nsIWebNavigation object to do anything with,
  // just bail. The client will have to have another way to deal with it
  if (!mNavigator) {
    return NS_OK;
  }

  // check that someone hasn't already handled this event
  PRBool preventDefault = PR_TRUE;
  nsCOMPtr<nsIDOMNSUIEvent> nsuiEvent(do_QueryInterface(inMouseEvent));
  if (nsuiEvent) {
    nsuiEvent->GetPreventDefault(&preventDefault);
  }

  if (preventDefault) {
    return NS_OK;
  }

  // pull the transferable out of the drag service. at the moment, we
  // only care about the first item of the drag. We don't allow
  // dropping multiple items into a content area.
  nsCOMPtr<nsIDragService> dragService =
    do_GetService("@mozilla.org/widget/dragservice;1");
  if (!dragService) {
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsIDragSession> session;
  dragService->GetCurrentSession(getter_AddRefs(session));
  if (!session) {
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsITransferable> trans =
    do_CreateInstance("@mozilla.org/widget/transferable;1");
  if (!trans) {
    return NS_ERROR_FAILURE;
  }

  // add the relevant flavors. order is important (highest fidelity to lowest)
  trans->AddDataFlavor(kURLDataMime);
  trans->AddDataFlavor(kURLMime);
  trans->AddDataFlavor(kFileMime);
  trans->AddDataFlavor(kUnicodeMime);

  // again, we only care about the first object
  nsresult rv = session->GetData(trans, 0);

  if (NS_SUCCEEDED(rv)) {
    // if the client has provided an override callback, call it. It may
    // still return that we should continue processing.
    nsCOMPtr<nsISimpleEnumerator> enumerator;
    GetHookEnumeratorFromEvent(inMouseEvent, getter_AddRefs(enumerator));

    if (enumerator) {
      PRBool actionCanceled = PR_TRUE;
      PRBool hasMoreHooks = PR_FALSE;
      while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreHooks))
             && hasMoreHooks) {
        nsCOMPtr<nsISupports> isupp;
        if (NS_FAILED(enumerator->GetNext(getter_AddRefs(isupp))))
          break;
        nsCOMPtr<nsIClipboardDragDropHooks> override =
          do_QueryInterface(isupp);

        if (override) {
#ifdef DEBUG
          nsresult hookResult =
#endif
          override->OnPasteOrDrop(inMouseEvent, trans, &actionCanceled);
          NS_ASSERTION(NS_SUCCEEDED(hookResult),
                       "hook failure in OnPasteOrDrop");
          if (!actionCanceled)
            return NS_OK;
        }
      }
    }

    nsXPIDLCString flavor;
    nsCOMPtr<nsISupports> dataWrapper;
    PRUint32 dataLen = 0;
    rv = trans->GetAnyTransferData(getter_Copies(flavor),
                                   getter_AddRefs(dataWrapper), &dataLen);
    if (NS_SUCCEEDED(rv) && dataLen > 0) {
      // get the url from one of several possible formats
      nsAutoString url;
      ExtractURLFromData(flavor, dataWrapper, dataLen, url);
      NS_ASSERTION(!url.IsEmpty(), "Didn't get anything we can use as a url");

      // valid urls don't have spaces. bail if this does.
      if (url.IsEmpty() || url.FindChar(' ') >= 0)
        return NS_OK;

      nsCOMPtr<nsIDOMDocument> sourceDocument;
      session->GetSourceDocument(getter_AddRefs(sourceDocument));

      nsCOMPtr<nsIDocument> sourceDoc(do_QueryInterface(sourceDocument));
      if (sourceDoc && sourceDoc->GetPrincipal()) {
        nsCOMPtr<nsIURI> sourceUri;
        sourceDoc->GetPrincipal()->GetURI(getter_AddRefs(sourceUri));

        if (sourceUri) {
          nsCAutoString sourceUriStr;
          sourceUri->GetSpec(sourceUriStr);

          rv = nsContentUtils::GetSecurityManager()->
            CheckLoadURIStr(sourceUriStr, NS_ConvertUTF16toUTF8(url),
                            nsIScriptSecurityManager::STANDARD);

          if (NS_FAILED(rv)) {
            // Security check failed, stop even propagation right here
            // and return the error.
            inMouseEvent->StopPropagation();

            return rv;
          }
        }
      }

      // ok, we have the url, load it.
      mNavigator->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull,
                          nsnull, nsnull);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

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 270 of file nsContentAreaDragDrop.cpp.

{
  // nothing really to do here.
  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 400 of file nsContentAreaDragDrop.cpp.

{
  // nothing really to do here.
  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 705 of file nsContentAreaDragDrop.cpp.

{
  // first check that someone hasn't already handled this event
  PRBool preventDefault = PR_TRUE;
  nsCOMPtr<nsIDOMNSUIEvent> nsuiEvent(do_QueryInterface(inMouseEvent));
  if (nsuiEvent) {
    nsuiEvent->GetPreventDefault(&preventDefault);
  }

  if (preventDefault) {
    return NS_OK;
  }

  // if the client has provided an override callback, check if we
  // should continue
  nsCOMPtr<nsISimpleEnumerator> enumerator;
  GetHookEnumeratorFromEvent(inMouseEvent, getter_AddRefs(enumerator));

  if (enumerator) {
    PRBool allow = PR_TRUE;
    PRBool hasMoreHooks = PR_FALSE;
    while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreHooks))
           && hasMoreHooks) {
      nsCOMPtr<nsISupports> isupp;
      if (NS_FAILED(enumerator->GetNext(getter_AddRefs(isupp))))
        break;

      nsCOMPtr<nsIClipboardDragDropHooks> override = do_QueryInterface(isupp);
      if (override) {
#ifdef DEBUG
        nsresult hookResult =
#endif
        override->AllowStartDrag(inMouseEvent, &allow);
        NS_ASSERTION(NS_SUCCEEDED(hookResult),
                     "hook failure in AllowStartDrag");

        if (!allow)
          return NS_OK;
      }
    }
  }

  nsCOMPtr<nsITransferable> trans;
  nsresult rv = CreateTransferable(inMouseEvent, getter_AddRefs(trans));
  if (NS_FAILED(rv))
    return rv;

  if (trans) {
    // if the client has provided an override callback, let them manipulate
    // the flavors or drag data
    nsCOMPtr<nsISimpleEnumerator> enumerator;
    GetHookEnumeratorFromEvent(inMouseEvent, getter_AddRefs(enumerator));
    if (enumerator) {
      PRBool hasMoreHooks = PR_FALSE;
      PRBool doContinueDrag = PR_TRUE;
      while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreHooks))
             && hasMoreHooks) {
        nsCOMPtr<nsISupports> isupp;
        if (NS_FAILED(enumerator->GetNext(getter_AddRefs(isupp))))
          break;
        nsCOMPtr<nsIClipboardDragDropHooks> override =
          do_QueryInterface(isupp);

        if (override) {
#ifdef DEBUG
          nsresult hookResult =
#endif
          override->OnCopyOrDrag(inMouseEvent, trans, &doContinueDrag);
          NS_ASSERTION(NS_SUCCEEDED(hookResult),
                       "hook failure in OnCopyOrDrag");

          if (!doContinueDrag) {
            return NS_OK;
          }
        }
      }
    }

    nsCOMPtr<nsISupportsArray> transArray =
      do_CreateInstance("@mozilla.org/supports-array;1");
    if (!transArray) {
      return NS_ERROR_FAILURE;
    }

    transArray->InsertElementAt(trans, 0);

    // kick off the drag
    nsCOMPtr<nsIDOMEventTarget> target;
    inMouseEvent->GetTarget(getter_AddRefs(target));
    nsCOMPtr<nsIDOMNode> targetNode(do_QueryInterface(target));
    nsCOMPtr<nsIDragService> dragService =
      do_GetService("@mozilla.org/widget/dragservice;1");

    if (!dragService) {
      return NS_ERROR_FAILURE;
    }

    dragService->InvokeDragSession(targetNode, transArray, nsnull,
                                   nsIDragService::DRAGDROP_ACTION_COPY +
                                   nsIDragService::DRAGDROP_ACTION_MOVE +
                                   nsIDragService::DRAGDROP_ACTION_LINK);
  }

  return NS_OK;
}

Here is the call graph for this function:

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 288 of file nsContentAreaDragDrop.cpp.

{
  // first check that someone hasn't already handled this event
  PRBool preventDefault = PR_TRUE;
  nsCOMPtr<nsIDOMNSUIEvent> nsuiEvent(do_QueryInterface(inEvent));
  if ( nsuiEvent )
    nsuiEvent->GetPreventDefault(&preventDefault);
  if ( preventDefault )
    return NS_OK;

  // if the drag originated w/in this content area, bail
  // early. This avoids loading a URL dragged from the content
  // area into the very same content area (which is almost never
  // the desired action).
  nsCOMPtr<nsIDragService> dragService =
    do_GetService("@mozilla.org/widget/dragservice;1");
  if (!dragService)
    return NS_ERROR_FAILURE;

  nsCOMPtr<nsIDragSession> session;
  dragService->GetCurrentSession(getter_AddRefs(session));

  if (session) {
    // if the client has provided an override callback, check if we
    // the drop is allowed. If it allows it, we should still protect
    // against dropping w/in the same document.
    PRBool dropAllowed = PR_TRUE;
    nsCOMPtr<nsISimpleEnumerator> enumerator;
    GetHookEnumeratorFromEvent(inEvent, getter_AddRefs(enumerator));

    if (enumerator) {
      PRBool hasMoreHooks = PR_FALSE;
      while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreHooks))
             && hasMoreHooks) {
        nsCOMPtr<nsISupports> isupp;
        if (NS_FAILED(enumerator->GetNext(getter_AddRefs(isupp)))) {
          break;
        }

        nsCOMPtr<nsIClipboardDragDropHooks> override =
          do_QueryInterface(isupp);

        if (override) {
#ifdef DEBUG
          nsresult hookResult =
#endif
          override->AllowDrop(inEvent, session, &dropAllowed);
          NS_ASSERTION(NS_SUCCEEDED(hookResult), "hook failure in AllowDrop");

          if (!dropAllowed) {
            break;
          }
        }
      }
    }

    nsCOMPtr<nsIDOMDocument> sourceDoc;
    session->GetSourceDocument(getter_AddRefs(sourceDoc));
    nsCOMPtr<nsIDOMDocument> eventDoc;
    GetEventDocument(inEvent, getter_AddRefs(eventDoc));

    if (sourceDoc == eventDoc) {  // common case
      dropAllowed = PR_FALSE;
    } else if (sourceDoc && eventDoc) {
      // dig deeper
      // XXXbz we need better ways to get from a document to the docshell!
      nsCOMPtr<nsIDocument> sourceDocument(do_QueryInterface(sourceDoc));
      nsCOMPtr<nsIDocument> eventDocument(do_QueryInterface(eventDoc));
      NS_ASSERTION(sourceDocument, "Confused document object");
      NS_ASSERTION(eventDocument, "Confused document object");

      nsIScriptGlobalObject * sourceGlobal =
        sourceDocument->GetScriptGlobalObject();
      nsIScriptGlobalObject* eventGlobal =
        eventDocument->GetScriptGlobalObject();

      if (sourceGlobal && eventGlobal) {
        nsCOMPtr<nsIDocShellTreeItem> sourceShell =
          do_QueryInterface(sourceGlobal->GetDocShell());
        nsCOMPtr<nsIDocShellTreeItem> eventShell =
          do_QueryInterface(eventGlobal->GetDocShell());

        if (sourceShell && eventShell) {
          // Whew.  Almost there.  Get the roots that are of the same type
          // (otherwise we'll always end up with the root docshell for the
          // window, and drag/drop from chrom to content won't work).
          nsCOMPtr<nsIDocShellTreeItem> sourceRoot;
          nsCOMPtr<nsIDocShellTreeItem> eventRoot;
          sourceShell->GetSameTypeRootTreeItem(getter_AddRefs(sourceRoot));
          eventShell->GetSameTypeRootTreeItem(getter_AddRefs(eventRoot));

          if (sourceRoot && sourceRoot == eventRoot) {
            dropAllowed = PR_FALSE;
          }
        }
      }
    }

    session->SetCanDrop(dropAllowed);
  }

  return NS_OK;
}

Here is the call graph for this function:

void nsContentAreaDragDrop::ExtractURLFromData ( const nsACString &  inFlavor,
nsISupports *  inDataWrapper,
PRUint32  inDataLen,
nsAString &  outURL 
) [private]

Definition at line 415 of file nsContentAreaDragDrop.cpp.

{
  if (!inDataWrapper) {
    return;
  }

  outURL.Truncate();

  if (inFlavor.Equals(kUnicodeMime)  || inFlavor.Equals(kURLDataMime)) {
    // the data is regular unicode, just go with what we get. It may
    // be a url, it may not be. *shrug*
    nsCOMPtr<nsISupportsString> stringData(do_QueryInterface(inDataWrapper));
    if (stringData) {
      stringData->GetData(outURL);
    }
  }
  else if (inFlavor.Equals(kURLMime)) {
    // the data is an internet shortcut of the form
    // <url>\n<title>. Strip out the url piece and return that.
    nsCOMPtr<nsISupportsString> stringData(do_QueryInterface(inDataWrapper));

    if (stringData) {
      nsAutoString data;
      stringData->GetData(data);
      PRInt32 separator = data.FindChar('\n');

      if (separator >= 0)
        outURL = Substring(data, 0, separator);
      else
        outURL = data;
    }
  }
  else if (inFlavor.Equals(kFileMime)) {
    // the data is a file. Use the necko parsing utils to get a file:// url
    // from the OS data.
    nsCOMPtr<nsIFile> file(do_QueryInterface(inDataWrapper));
    if (file) {
      nsCAutoString url;
      NS_GetURLSpecFromFile(file, url);
      CopyUTF8toUTF16(url, outURL);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsContentAreaDragDrop::GetEventDocument ( nsIDOMEvent inEvent,
nsIDOMDocument **  outDocument 
) [static, private]

Definition at line 645 of file nsContentAreaDragDrop.cpp.

{
  *outDocument = nsnull;

  nsCOMPtr<nsIDOMUIEvent> uiEvent(do_QueryInterface(inEvent));
  if (uiEvent) {
    nsCOMPtr<nsIDOMAbstractView> view;
    uiEvent->GetView(getter_AddRefs(view));
    nsCOMPtr<nsIDOMWindow> window(do_QueryInterface(view));

    if (window) {
      window->GetDocument(outDocument);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIFlavorDataProvider::getFlavorData ( in nsITransferable  aTransferable,
in string  aFlavor,
out nsISupports  aData,
out unsigned long  aDataLen 
) [inherited]

Retrieve the data from this data provider.

Parameters:
aTransferable(in parameter) the transferable we're being called for.
aFlavor(in parameter) the flavor of data to retrieve
aDatathe data. Some variant of class in nsISupportsPrimitives.idl
aDataLenthe length of the data

Definition at line 672 of file nsContentAreaDragDrop.cpp.

{
  *outEnumerator = nsnull;

  nsCOMPtr<nsIDOMDocument> domdoc;
  GetEventDocument(inEvent, getter_AddRefs(domdoc));
  nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
  NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);

  nsCOMPtr<nsISupports> container = doc->GetContainer();
  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
  NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);

  nsCOMPtr<nsIClipboardDragDropHookList> hookList = do_GetInterface(docShell);
  NS_ENSURE_TRUE(hookList, NS_ERROR_FAILURE);
  nsCOMPtr<nsISimpleEnumerator> enumerator;
  hookList->GetHookEnumerator(getter_AddRefs(enumerator));
  NS_ENSURE_TRUE(enumerator, NS_ERROR_FAILURE);

  *outEnumerator = enumerator;
  NS_ADDREF(*outEnumerator);

  return NS_OK;
}

Here is the call graph for this function:

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 813 of file nsContentAreaDragDrop.cpp.

{
  return NS_OK;

}
void nsIDragDropHandler::hookupTo ( in nsIDOMEventTarget  attachPoint,
in nsIWebNavigation  navigator 
) [inherited]

Attach drag handlers to receiver specified by |attachPoint| and specify callbacks to allow overriding of the built-in behaviors.

Parameters:
attachPointhookup listeners to this location
navigatorloads dropped urls via this interface. If NULL, the client must handle the drop itself, either through the method provided via |overrideDrop| or by letting the event bubble up through the DOM.
void nsContentAreaDragDrop::NormalizeSelection ( nsIDOMNode inBaseNode,
nsISelection inSelection 
) [static, private]

Definition at line 604 of file nsContentAreaDragDrop.cpp.

{
  nsCOMPtr<nsIDOMNode> parent;
  inBaseNode->GetParentNode(getter_AddRefs(parent));
  if (!parent || !inSelection)
    return;

  nsCOMPtr<nsIDOMNodeList> childNodes;
  parent->GetChildNodes(getter_AddRefs(childNodes));
  if (!childNodes)
    return;
  PRUint32 listLen = 0;
  childNodes->GetLength(&listLen);

  PRUint32 index = 0;
  for (; index < listLen; ++index) {
    nsCOMPtr<nsIDOMNode> indexedNode;
    childNodes->Item(index, getter_AddRefs(indexedNode));
    if (indexedNode == inBaseNode) {
      break;
    }
  }

  if (index >= listLen) {
    return;
  }

  // now make the selection contain all of |inBaseNode|'s siblings up
  // to and including |inBaseNode|
  inSelection->Collapse(parent, index);
  inSelection->Extend(parent, index+1);
}

Here is the call graph for this function:

Definition at line 244 of file nsContentAreaDragDrop.cpp.

Here is the caller graph for this function:

nsresult nsContentAreaDragDrop::SaveURIToFile ( nsAString &  inSourceURIString,
nsIFile inDestFile 
) [static, private]

Definition at line 827 of file nsContentAreaDragDrop.cpp.

{
  nsCOMPtr<nsIURI> sourceURI;
  nsresult rv = NS_NewURI(getter_AddRefs(sourceURI), inSourceURIString);
  if (NS_FAILED(rv)) {
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsIURL> sourceURL = do_QueryInterface(sourceURI);
  if (!sourceURL) {
    return NS_ERROR_NO_INTERFACE;
  }

  rv = inDestFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
  NS_ENSURE_SUCCESS(rv, rv);

  // we rely on the fact that the WPB is refcounted by the channel etc,
  // so we don't keep a ref to it. It will die when finished.
  nsCOMPtr<nsIWebBrowserPersist> persist =
    do_CreateInstance("@mozilla.org/embedding/browser/nsWebBrowserPersist;1",
                      &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  return persist->SaveURI(sourceURI, nsnull, nsnull, nsnull, nsnull,
                          inDestFile);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 123 of file nsContentAreaDragDrop.h.

Definition at line 121 of file nsContentAreaDragDrop.h.

Definition at line 126 of file nsContentAreaDragDrop.h.


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