[Local Media Casting] Automatically fullscreen local media casting video files.

This change adds back a previously removed blink API on WebElement to
fullscreen an element.

This API is then wired up to media router UI and the local media casting flow to
fullscreen the first video element as soon as it is loaded.

Bug: 777005
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I3d4e24c2a8d45edbfa612312a21053086750df11
Reviewed-on: https://chromium-review.googlesource.com/731669
Commit-Queue: Adam Parker <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Yuri Wiitala <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: mark a. foltz <[email protected]>
Cr-Commit-Position: refs/heads/master@{#527835}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 289acc8..c34468e 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -41,6 +41,7 @@
 #include "content/common/url_loader_factory_bundle.h"
 #include "content/common/widget.mojom.h"
 #include "content/public/common/console_message_level.h"
+#include "content/public/common/fullscreen_video_element.mojom.h"
 #include "content/public/common/javascript_dialog_type.h"
 #include "content/public/common/previews_state.h"
 #include "content/public/common/referrer.h"
@@ -182,6 +183,7 @@
       blink::mojom::MediaEngagementClient,
       mojom::Frame,
       mojom::FrameNavigationControl,
+      mojom::FullscreenVideoElementHandler,
       mojom::HostZoom,
       mojom::FrameBindingsControl,
       public blink::WebFrameClient,
@@ -532,6 +534,9 @@
       const base::Optional<std::string>& error_page_content,
       base::Optional<URLLoaderFactoryBundle> subresource_loaders) override;
 
+  // mojom::FullscreenVideoElementHandler implementation:
+  void RequestFullscreenVideoElement() override;
+
   // mojom::HostZoom implementation:
   void SetHostZoomLevel(const GURL& url, double zoom_level) override;
 
@@ -748,6 +753,10 @@
   // Binds to the site engagement service in the browser.
   void BindEngagement(blink::mojom::EngagementClientAssociatedRequest request);
 
+  // Binds to the fullscreen service in the browser.
+  void BindFullscreen(
+      mojom::FullscreenVideoElementHandlerAssociatedRequest request);
+
   // Binds to the media engagement service in the browser.
   void BindMediaEngagement(
       blink::mojom::MediaEngagementClientAssociatedRequest request);
@@ -1525,6 +1534,8 @@
       frame_bindings_control_binding_;
   mojo::AssociatedBinding<mojom::FrameNavigationControl>
       frame_navigation_control_binding_;
+  mojo::AssociatedBinding<mojom::FullscreenVideoElementHandler>
+      fullscreen_binding_;
 
   // Indicates whether |didAccessInitialDocument| was called.
   bool has_accessed_initial_document_;