Commit b17ceb36 authored by François Beaufort's avatar François Beaufort Committed by Commit Bot

Picture-in-Picture controls background covers window.

This CL makes sures when screen resolution is not the default one,
controls background still covers entirely the video. It does so by
adding one pixel in width and height to the size of the controls
background view.

Bug: 876293
Change-Id: I005e8d0a4fd178a05ab794851c5ae22507a7343f
Reviewed-on: https://chromium-review.googlesource.com/1183486Reviewed-by: default avatarapacible <apacible@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#585163}
parent 836caeb1
......@@ -217,7 +217,11 @@ gfx::Rect OverlayWindowViews::CalculateAndUpdateWindowBounds() {
void OverlayWindowViews::SetUpViews() {
// views::View that is displayed when video is hidden. ----------------------
window_background_view_->SetSize(GetBounds().size());
// Adding an extra pixel to width/height makes sure controls background cover
// entirely window when platform has fractional scale applied.
gfx::Rect larger_window_bounds = GetBounds();
larger_window_bounds.Inset(-1, -1);
window_background_view_->SetSize(larger_window_bounds.size());
window_background_view_->SetPaintToLayer(ui::LAYER_SOLID_COLOR);
GetWindowBackgroundLayer()->SetColor(SK_ColorBLACK);
......@@ -309,8 +313,12 @@ void OverlayWindowViews::UpdateControlsVisibility(bool is_visible) {
}
void OverlayWindowViews::UpdateControlsBounds() {
// Adding an extra pixel to width/height makes sure controls background cover
// entirely window when platform has fractional scale applied.
gfx::Rect larger_window_bounds = GetBounds();
larger_window_bounds.Inset(-1, -1);
controls_background_view_->SetBoundsRect(
gfx::Rect(gfx::Point(0, 0), GetBounds().size()));
gfx::Rect(gfx::Point(0, 0), larger_window_bounds.size()));
close_controls_view_->SetPosition(GetBounds().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