return NS_ERROR_NO_INTERFACE;
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(content)); if (receiver) {  nsCOMPtr<nsIDOMEventListener> listener; QueryInterface(NS_GET_IID(nsIDOMEventListener), getter_AddRefs(listener));   receiver->AddEventListenerByIID(listener, NS_GET_IID(nsIDOMFocusListener));   receiver->AddEventListenerByIID(listener, NS_GET_IID(nsIDOMMouseListener));   receiver->AddEventListenerByIID(listener, NS_GET_IID(nsIDOMMouseMotionListener));   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);   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); }     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;
nsresult nsPluginDOMContextMenuListener::Init(nsObjectFrame *aFrame){  nsIContent* content = aFrame->GetContent();  // Register context menu listener  if (content) {    nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(content));    if (receiver) {      nsCOMPtr<nsIDOMContextMenuListener> cxMenuListener;      QueryInterface(NS_GET_IID(nsIDOMContextMenuListener), getter_AddRefs(cxMenuListener));      if (cxMenuListener) {        receiver->AddEventListener(NS_LITERAL_STRING("contextmenu"), cxMenuListener, PR_TRUE);        return NS_OK;      }    }  }  return NS_ERROR_NO_INTERFACE;}