[Picture-in-Picture] Resolve promises when window is created and closed.

This makes the promise returned by enterPictureInPicture() resolved only
when window is created. Picture-in-Picture window size is still
hard-coded though and will be fixed in a future CL.
This also makes the promise returned by exitPictureInPicture() resolved
only when window is closed.

Bug: 806249
Change-Id: I8232a42a50b808527560eb0e6a69d8fb98da63e4
Reviewed-on: https://chromium-review.googlesource.com/1025832
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: apacible <apacible@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#556567}
31 files changed