64313 (Implement cmd_copyLink, cmd_copyImageLocation, cmd_copyImageContents). Implement the commands, hook them up in the navigator and mailnews frontends, provide hooks for embedding. r=hyatt, sr=waterson

git-svn-id: svn://10.0.0.236/trunk@92667 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dr%netscape.com
2001-04-18 06:06:31 +00:00
parent 75929d9555
commit 58190bba57
24 changed files with 1449 additions and 329 deletions

View File

@@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
@@ -20,6 +20,7 @@
* Travis Bogard <travis@netscape.com>
* Adam Lock <adamlock@netscape.com>
* Mike Pinkerton <pinkerton@netscape.com>
* Dan Rosen <dr@netscape.com>
*/
// Local Includes
@@ -1467,6 +1468,27 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
node = parentNode;
} while (node);
// we need to cache the event target into the focus controller's popupNode
// so we can get at it later from command code, etc.:
// get the dom window
nsCOMPtr<nsIDOMWindow> win;
res = mWebBrowser->GetContentDOMWindow(getter_AddRefs(win));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(win, NS_ERROR_FAILURE);
// get the private dom window
nsCOMPtr<nsPIDOMWindow> privateWin(do_QueryInterface(win, &res));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(privateWin, NS_ERROR_FAILURE);
// get the focus controller
nsCOMPtr<nsIFocusController> focusController;
res = privateWin->GetRootFocusController(getter_AddRefs(focusController));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(focusController, NS_ERROR_FAILURE);
// set the focus controller's popup node to the event target
res = focusController->SetPopupNode(targetDOMnode);
NS_ENSURE_SUCCESS(res, res);
// Tell the listener all about the event
nsCOMPtr<nsIContextMenuListener> menuListener(do_QueryInterface(mWebBrowserChrome));
if ( menuListener )