Commit bd8a51d5 authored by Jennifer Apacible's avatar Jennifer Apacible Committed by Commit Bot

[Picture in Picture] Hide controls on all platforms while resizing/moving.

This change hides the controls on the Picture-in-Picture window on all
platforms while moving the window or when the size updates. Previously,
this was handled on Windows.

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.

Bug: 877987
Change-Id: I788d8cb5690e3c587f93b21ad7eb7d0a2c69ecef
Reviewed-on: https://chromium-review.googlesource.com/1197722Reviewed-by: default avatarCJ DiMeglio <lethalantidote@chromium.org>
Commit-Queue: apacible <apacible@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587832}
parent 8a7002dd
...@@ -593,12 +593,6 @@ void OverlayWindowViews::OnNativeWidgetWorkspaceChanged() { ...@@ -593,12 +593,6 @@ void OverlayWindowViews::OnNativeWidgetWorkspaceChanged() {
// does not trigger this function. http://crbug.com/819673 // 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::OnKeyEvent(ui::KeyEvent* event) { void OverlayWindowViews::OnKeyEvent(ui::KeyEvent* event) {
// Every time a user uses a keyboard to interact on the window, restart the // Every time a user uses a keyboard to interact on the window, restart the
// timer to automatically hide the controls. // timer to automatically hide the controls.
...@@ -722,6 +716,11 @@ void OverlayWindowViews::OnNativeBlur() { ...@@ -722,6 +716,11 @@ void OverlayWindowViews::OnNativeBlur() {
} }
void OverlayWindowViews::OnNativeWidgetMove() { void OverlayWindowViews::OnNativeWidgetMove() {
// Hide the controls when the window is moving. The controls will reappear
// when the user interacts with the window again.
if (is_initialized_)
UpdateControlsVisibility(false);
// Update the existing |window_bounds_| when the window moves. This allows // Update the existing |window_bounds_| when the window moves. This allows
// the window to reappear with the same origin point when a new video is // the window to reappear with the same origin point when a new video is
// shown. // shown.
...@@ -729,6 +728,11 @@ void OverlayWindowViews::OnNativeWidgetMove() { ...@@ -729,6 +728,11 @@ void OverlayWindowViews::OnNativeWidgetMove() {
} }
void OverlayWindowViews::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { void OverlayWindowViews::OnNativeWidgetSizeChanged(const gfx::Size& new_size) {
// Hide the controls when the window is being resized. The controls will
// reappear when the user interacts with the window again.
if (is_initialized_)
UpdateControlsVisibility(false);
// Update the view layers to scale to |new_size|. // Update the view layers to scale to |new_size|.
UpdateCustomControlsSize(first_custom_controls_view_.get()); UpdateCustomControlsSize(first_custom_controls_view_.get());
UpdateCustomControlsSize(second_custom_controls_view_.get()); UpdateCustomControlsSize(second_custom_controls_view_.get());
......
...@@ -48,7 +48,6 @@ class OverlayWindowViews : public content::OverlayWindow, ...@@ -48,7 +48,6 @@ class OverlayWindowViews : public content::OverlayWindow,
gfx::Size GetMinimumSize() const override; gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override; gfx::Size GetMaximumSize() const override;
void OnNativeWidgetWorkspaceChanged() override; void OnNativeWidgetWorkspaceChanged() override;
void OnNativeWidgetBeginUserBoundsChange() override;
void OnKeyEvent(ui::KeyEvent* event) override; void OnKeyEvent(ui::KeyEvent* event) override;
void OnMouseEvent(ui::MouseEvent* event) override; void OnMouseEvent(ui::MouseEvent* event) override;
void OnGestureEvent(ui::GestureEvent* 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