Add View Image item to link popup menu in mfcembed to catch image links. b=194954 r=chak@netscape.com sr=alecf@netscape.com

This commit is contained in:
locka%iol.ie 2003-02-26 14:54:37 +00:00
parent 0658c7676a
commit 89396637a2
2 changed files with 16 additions and 0 deletions

View File

@ -387,6 +387,20 @@ void CBrowserFrame::BrowserFrameGlueObj::ShowContextMenu(PRUint32 aContextFlags,
// Update the view with the new LinkUrl
// Note that this string is in UCS2 format
pThis->m_wndBrowserView.SetCtxMenuLinkUrl(strUrlUcs2);
// Test if there is an image URL as well
nsCOMPtr<nsIURI> imgURI;
aInfo->GetImageSrc(getter_AddRefs(imgURI));
if(imgURI)
{
nsCAutoString strImgSrcUtf8;
imgURI->GetSpec(strImgSrcUtf8);
if(!strImgSrcUtf8.IsEmpty())
{
// Set the new Img Src
pThis->m_wndBrowserView.SetCtxMenuImageSrc(NS_ConvertUTF8toUCS2(strImgSrcUtf8));
}
}
}
else if(aContextFlags & nsIContextMenuListener2::CONTEXT_IMAGE)
{

View File

@ -229,6 +229,8 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&View Page Source", ID_VIEW_SOURCE
MENUITEM SEPARATOR
MENUITEM "View &Image", ID_VIEW_IMAGE
MENUITEM SEPARATOR
MENUITEM "Save &Page As...", ID_FILE_SAVE_AS
MENUITEM "Save &Link As...", ID_SAVE_LINK_AS
MENUITEM "&Copy Link Location", ID_COPY_LINK_LOCATION