Bug 143794 - [Mac] Disable "Save to Downloads" option for local files
Summary: [Mac] Disable "Save to Downloads" option for local files
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 144267
  Show dependency treegraph
 
Reported: 2015-04-15 13:06 PDT by Brent Fulgham
Modified: 2015-04-27 10:45 PDT (History)
2 users (show)

See Also:


Attachments
Patch (7.46 KB, patch)
2015-04-15 15:05 PDT, Brent Fulgham
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>