[filesapp] Use dedicated API to fetch ARC DocumentsProvider thumbnails

Add a special case for ARC DocumentsProvider URLs to the image loader to
fetch thumbnails using a dedicated fileManagerPrivate function. The
function checks document metadata for a thumbnail support flag, and, if
set, fetches the actual thumbnail via a mojo call to ARC.

If the document does not have a thumbnail, no thumbnail is rendered,
rather than falling back to download the original file and resizing it
into thumbnail.

Mojo struct Size was moved from video_common.mojom to gfx.mojom as it's
now used by the filesystem API as well.

Bug: 1049966
Change-Id: I758c7558ede42b01ad877b6f14781d51f6e1f0a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2473857
Commit-Queue: Alexander Bolodurin <alexbn@google.com>
Reviewed-by: Noel Gordon <noel@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819325}
GitOrigin-RevId: 5b21741ba599bdee9e80fc9c094db0073f43c65e
diff --git a/file_manager_private.js b/file_manager_private.js
index f100212..7046857 100644
--- a/file_manager_private.js
+++ b/file_manager_private.js
@@ -1136,6 +1136,19 @@
 chrome.fileManagerPrivate.getPdfThumbnail = function(entry, width, height, callback) {};
 
 /**
+  Retrieves a thumbnail of an ARC DocumentsProvider file, close in size to
+  |widthHint| and |heightHint|, but not necessarily exactly this size.
+ * @param {!FileEntry} entry
+ * @param {number} widthHint
+ * @param {number} heightHint
+ * @param {function(string): void} callback |thumbnailDataUrl| A data URL for the
+ *     thumbnail; |thumbnailDataUrl| is empty if no thumbnail was available.
+ *     Note: The thumbnail data may originate from third-party application code,
+ *     and is untrustworthy (Security).
+ */
+chrome.fileManagerPrivate.getArcDocumentsProviderThumbnail = function(entry, widthHint, heightHint, callback) {};
+
+/**
  * @param {!Array<string>} extensions
  * @param {function(!Array<chrome.fileManagerPrivate.AndroidApp>): void} callback
  *     Completion callback.