Bug 143794

Summary: [Mac] Disable "Save to Downloads" option for local files
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=143612
Bug Depends on:    
Bug Blocks: 144267    
Attachments:
Description Flags
Patch thorton: review+

Description Brent Fulgham 2015-04-15 13:06:24 PDT
The existing download infrastructure fails silently when asked to "Download" a local file. We should not give the illusion that this action will work, so let's disable the menu item for local files.

I have filed a separate bug (Bug 143612) to get this feature to work properly.
Comment 1 Brent Fulgham 2015-04-15 15:05:03 PDT
Created attachment 250867 [details]
Patch
Comment 2 Brent Fulgham 2015-04-15 15:06:13 PDT
<rdar://problem/18858089>
Comment 3 Tim Horton 2015-04-15 15:10:18 PDT
Comment on attachment 250867 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250867&action=review

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:267
> +        [saveToDownloadsItem setEnabled:NO];

See the "enabled = hitTestResult->allowsCopy();" down in _createActionMenuItemForTag? Do this there, that way if we add the item to multiple menus we don't have to worry about duplicating this logic.

> Source/WebKit/mac/WebView/WebActionMenuController.mm:312
> +    if (WebCore::protocolIs(_hitTestResult.absoluteImageURL(), "file"))

ditto
Comment 4 Brent Fulgham 2015-04-15 20:58:51 PDT
Committed r182879: <http://trac.webkit.org/changeset/182879>