Commit 860ec28b authored by Jennifer Apacible's avatar Jennifer Apacible Committed by Commit Bot

[Picture in Picture] Hide controls when the window is resizing/dragged.

Currently, the controls on the Picture-in-Picture window are shown while
the window is being resized or dragged. The scaling of the controls is
not very smooth while the window is resized.

The controls cannot be interacted with during the resize and dragging
actions. They also slightly obscure the video, especially the play/pause
icon. Removing the controls will allow the user to view the final video
size and position.

The controls are shown again when the user hovers over / interacts with
the window.

Bug: 877987
Change-Id: Ic50b2a330a811540914d9675b068cc561a652bbd
Reviewed-on: https://chromium-review.googlesource.com/1191026Reviewed-by: default avatarCJ DiMeglio <lethalantidote@chromium.org>
Commit-Queue: apacible <apacible@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586800}
parent fcd2e3a1
......@@ -590,6 +590,12 @@ void OverlayWindowViews::OnNativeWidgetWorkspaceChanged() {
// does not trigger this function. http://crbug.com/819673
}
void OverlayWindowViews::OnNativeWidgetBeginUserBoundsChange() {
// Hide the controls when the window is being dragged or resized. The
// controls will reappear when the user hovers over the window again.
UpdateControlsVisibility(false);
}
void OverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
switch (event->type()) {
// Only show the media controls when the mouse is hovering over the window.
......
......@@ -48,6 +48,7 @@ class OverlayWindowViews : public content::OverlayWindow,
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;
void OnNativeWidgetWorkspaceChanged() override;
void OnNativeWidgetBeginUserBoundsChange() override;
void OnMouseEvent(ui::MouseEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment