+dev-gaia
On Tue, Mar 26, 2013 at 2:19 PM, Vivien <
vnic...@mozilla.com> wrote:
> On 22/03/2013 08:12, Casey Yee wrote:
> > Hey Etienne!
> > These questions have made it around to a few places now, but I hear you
> are the one that may have the answers!
> >
> > I'm working on UX design around how uploads and downloads are handled in
> their various forms on the platform and I have a few questions about HTTP
> downloads that I think you may be able to help out with:
>
> Can you describe a little bit more what you want to do exactly? Is it
> like a kind of Download center? Otherwise the main issue I see is that
> all apps handled downloads separately. So for example if you click on a
> pdf file in the browser the file will be download by the pdf.js
> application, not by the system or by the platform. What it means is
> whatever you want to do it has to be done on a per app basis if the
> current workflow is kept. And those apps does not have more or less
> control than what a regular web page can do with an XHR (except that an
> app can have systemXHR privileges and so can request cross domain
> resources).
>
The way that audio and video downloads are currently being implemented in a
patch for the browser in bug
853351<
https://bugzilla.mozilla.org/show_bug.cgi?id=853351>is for the
browser to initiate an XHR from a context menu and save directly
to DeviceStorage. The problem with this approach is that the system app has
no way of knowing this download has been initiated so can't display the
download manager UI in the utility tray as shown in the UX spec
https://www.dropbox.com/s/1fb2yxa7yb74403/browser-downloading-draft.pdf
My suggestion in bug
848371<
https://bugzilla.mozilla.org/show_bug.cgi?id=848371>was to have
a more generic mechanism where whenever Gecko comes across a
MIME type it can't render, it fires an event (or even a download web
activity) which the system app can catch in order to manage that download.
The system app could then display the download UI and put the file in the
correct place in DeviceStorage based on the MIME type in the blob (as the
patch in bug 853351 <
https://bugzilla.mozilla.org/show_bug.cgi?id=853351>does).
If the system app sends the XHR then it can display the UI in the utility
tray as shown in the UX spec, but there is the issue of authenticated
resources as Vivien mentioned because the system app has a different data
jar to e.g. the browser app.
Gecko can fire a web activity when the user navigates directly to a file
when browsing, and if an app wants to trigger downloads in different ways
(by long pressing on a hyperlink or long pressing on an audio or video
element for example) the app could fire a "download" web activity itself.
Do you think that would work?
Ben
--
Ben Francis
http://tola.me.uk