Call <file-safe-media> webview contentChanged when content loads

Add JS content load handlers to the <file-safe-media> webview #content
element: onloadeddata for <video> and <audio>, and onload for the rest
which currently means <image> [1].

Call contentChanged when these load handlers fire: to confirm that the
audio|image|video loaded, and send the 'webview-loaded' message to the
parent <file-safe-media>. The parent <file-safe-media> responds to the
message by setting the <webview> 'loaded' attribute: see CL:1256469.

[1] The 'html' <file-safe-media> use-case already handles 'onload' via
the HTML fetch API, and invokes contentChanged when fetch returns HTML
text to render.

Test: browser_tests --gtest_filter="QuickView*FilesAppBrowserTest*"
Bug: 891150
Change-Id: I12d65a20be3cce570c90b5e0a8fd9e20bd77985c
Reviewed-on: https://chromium-review.googlesource.com/c/1267838
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597491}
1 file changed