Picture-in-Picture: resolve requestPictureInPicture with window size.

Resolves the Web API promise with the actual size of the window after
it was created. As a side effect, the promise is now resolved when the
window is actually created instead of slightly after the call.

Bug: 806249
Change-Id: Iab88e31ba2c1b6efcc5691dca43b02eee1e79412
Reviewed-on: https://chromium-review.googlesource.com/1060533
Commit-Queue: Mounir Lamouri <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Reviewed-by: apacible <[email protected]>
Reviewed-by: Frank Liberato <[email protected]>
Reviewed-by: Peter Kasting <[email protected]>
Reviewed-by: François Beaufort <[email protected]>
Cr-Commit-Position: refs/heads/master@{#560470}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 76feed1..fe0cfe25 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -6112,6 +6112,13 @@
     outermost->SetAsFocusedWebContentsIfNecessary();
 }
 
+gfx::Size WebContentsImpl::EnterPictureInPicture(
+    const viz::SurfaceId& surface_id,
+    const gfx::Size& natural_size) {
+  return delegate_ ? delegate_->EnterPictureInPicture(surface_id, natural_size)
+                   : gfx::Size();
+}
+
 void WebContentsImpl::ExitPictureInPicture() {
   if (delegate_)
     delegate_->ExitPictureInPicture();