DevTools: intercept file chooser requests

One of the big issues of web automation is handling file uploads.
Many uploads are created "on the fly" without touching page's DOM:

  const e = document.createElement('input');
  e.type = 'file';
  e.click();

As a result, the |DOM.setFileInputFiles| method is not applicable since
clients can't get a reference to |e|.

This patch suggests an alternative approach to intercept file chooser
dialogs.

With file chooser interception, protocol clients:
- enable file chooser interception with |page.setInterceptFileChooserDialog| command
- subscribe to the |page.fileChooserOpened| event
- handle file choosers with |page.handleFileChooser| command

The implementation resides in the //content layer to handle both //chrome
and //headless embedders.

NOTE: With file chooser interception enabled, the
native "file chooser" UI is not shown since the control belongs to
DevTools.

For the record: this is a re-upload of https://crrev.com/c/1661775

Change-Id: Ibbc8826845c94818a6cb03c8b59ae95237478286
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679638
Commit-Queue: Andrey Lushnikov <[email protected]>
Reviewed-by: Dmitry Gozman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#673121}
15 files changed