Index: Source/web/ContextMenuClientImpl.cpp |
diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp |
index e7d9688ba2e7411ecc4141a9c6953e01668ff079..09f63760904c17d1f6e8afcc9a72beb7798dc9fe 100644 |
--- a/Source/web/ContextMenuClientImpl.cpp |
+++ b/Source/web/ContextMenuClientImpl.cpp |
@@ -46,6 +46,7 @@ |
#include "core/frame/Settings.h" |
#include "core/html/HTMLAnchorElement.h" |
#include "core/html/HTMLFormElement.h" |
+#include "core/html/HTMLImageElement.h" |
#include "core/html/HTMLInputElement.h" |
#include "core/html/HTMLMediaElement.h" |
#include "core/html/HTMLPlugInElement.h" |
@@ -230,6 +231,13 @@ void ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu) |
// An image can be null for many reasons, like being blocked, no image |
// data received from server yet. |
data.hasImageContents = r.image() && !r.image()->isNull(); |
+ if (data.hasImageContents) { |
+ // We know that if absoluteImageURL() is not empty, then this |
+ // is a image element. |
+ HTMLImageElement* imageElement = toHTMLImageElement(r.innerNodeOrImageMapImage()); |
+ // TODO: Change "via" to "chrome-proxy" once the server starts sending lo-fi responses. |
+ data.imageChromeProxyResponseHeader = imageElement->imageLoader().image()->response().httpHeaderField("via").utf8().data(); |
Nate Chapin
2015/05/01 18:46:51
What is "via"? It seems wrong to be digging down i
megjablon
2015/05/01 19:15:23
We need a way of telling the context menu that an
|
+ } |
} else if (!r.absoluteMediaURL().isEmpty()) { |
data.srcURL = r.absoluteMediaURL(); |