Commit a128a1b9 authored by yoshiki iguchi's avatar yoshiki iguchi Committed by Commit Bot

Update background of arc notifications on setting surface

This CL updates the background of arc notification when surface is
set from null or to null.

Some notifications have transparent area, so we have to draw a blank
background correctly when necessary.

Bug: 876430
Change-Id: I273be6a01b4dfde1944f0f720c3ac29e4cfeadfa
Reviewed-on: https://chromium-review.googlesource.com/1216582
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: default avatarEliot Courtney <edcourtney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590580}
parent e59ae0a0
......@@ -396,6 +396,11 @@ void ArcNotificationContentView::SetSurface(ArcNotificationSurface* surface) {
if (surface_ == surface)
return;
// Set the flag to change the visibility of the snapshot on the background
// when the surface is set or unset. The surface sets while the window on
// Android side is visible.
bool need_to_update_snapshot = (surface_ == nullptr || surface == nullptr);
// Reset |floating_control_buttons_widget_| when |surface_| is changed.
floating_control_buttons_widget_.reset();
......@@ -430,6 +435,10 @@ void ArcNotificationContentView::SetSurface(ArcNotificationSurface* surface) {
AttachSurface();
}
}
// Schedules to draw the background (snapshot or a blank).
if (need_to_update_snapshot)
SchedulePaint();
}
void ArcNotificationContentView::UpdatePreferredSize() {
......
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