Chromium Code Reviews| Index: Source/web/ContextMenuClientImpl.cpp |
| diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp |
| index 8d61b79c6601697230ff3900a89c436deaa764ea..f2d2191c159fcebfef2cd71eccce06d953138d12 100644 |
| --- a/Source/web/ContextMenuClientImpl.cpp |
| +++ b/Source/web/ContextMenuClientImpl.cpp |
| @@ -43,6 +43,7 @@ |
| #include "core/frame/FrameView.h" |
| #include "core/frame/PinchViewport.h" |
| #include "core/frame/Settings.h" |
| +#include "core/html/HTMLAnchorElement.h" |
| #include "core/html/HTMLFormElement.h" |
| #include "core/html/HTMLInputElement.h" |
| #include "core/html/HTMLMediaElement.h" |
| @@ -371,6 +372,12 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM |
| // Filter out custom menu elements and add them into the data. |
| populateCustomMenuItems(defaultMenu, &data); |
| + // Extract suggested filename for saving file. |
| + if (isHTMLAnchorElement(r.URLElement())) { |
| + HTMLAnchorElement* anchor = toHTMLAnchorElement(r.URLElement()); |
| + data.suggestedFilename = anchor->fastGetAttribute(HTMLNames::downloadAttr); |
| + } |
|
abarth-chromium
2014/06/18 23:38:48
Why not put this information in WebCore::ContextMe
asanka
2014/06/19 21:22:19
As in, eliminate WebContextMenuData?
|
| + |
| data.node = r.innerNonSharedNode(); |
| WebLocalFrameImpl* selectedWebFrame = WebLocalFrameImpl::fromFrame(selectedFrame); |