Commit 089c3c38 authored by Jennifer Apacible's avatar Jennifer Apacible Committed by Commit Bot

[Picture in Picture] Adhere to aspect ratio for resize.

Currently, resizing sometimes doesn't always adhere to the aspect
ratio when the window also moves (origin point updates) alongside it.

OnNativeWidgetMove() is called in these cases. With this change, if the
sizes of the previous and new bounds are the same, the window was only
moved rather than resized. This change will make
OnNativeWidgetSizeChanged() handle the updates for |current_bounds_|.

BUG: 829677
Change-Id: Id7df25c0a888efa4b2a7cad39cf83105aa03a759
Reviewed-on: https://chromium-review.googlesource.com/1071125Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: apacible <apacible@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562009}
parent cb593be9
......@@ -434,7 +434,12 @@ void OverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
}
void OverlayWindowViews::OnNativeWidgetMove() {
current_bounds_ = GetBounds();
// If the sizes are the same, |this| was moved. Otherwise, this can be also
// called when the window resizes. Let OnNativeWidgetSizeChanged() handle
// all resizing.
if (GetBounds().size() == current_bounds_.size())
current_bounds_ = GetBounds();
views::Widget::OnNativeWidgetMove();
}
void OverlayWindowViews::OnNativeWidgetSizeChanged(const gfx::Size& new_size) {
......
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