diff --git a/embedding/tests/mfcembed/BrowserFrameGlue.cpp b/embedding/tests/mfcembed/BrowserFrameGlue.cpp index 0a14aebbcb69..bc9c85cccc03 100644 --- a/embedding/tests/mfcembed/BrowserFrameGlue.cpp +++ b/embedding/tests/mfcembed/BrowserFrameGlue.cpp @@ -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 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) { diff --git a/embedding/tests/mfcembed/MfcEmbed.rc b/embedding/tests/mfcembed/MfcEmbed.rc index cbf6f49d7346..5810d57654ca 100644 --- a/embedding/tests/mfcembed/MfcEmbed.rc +++ b/embedding/tests/mfcembed/MfcEmbed.rc @@ -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