Commit c17b12c1 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Fix asan failure for slider bubble.

UnifiedSliderBubbleController was not handling events properly when
the previous bubble was closing e.g. volume key was pressed during
brightness slider is fading out.

TEST=manual
BUG=866301

Change-Id: I93087c01b38cbd7d5f64f8c99c9e0c539113f8d8
Reviewed-on: https://chromium-review.googlesource.com/1159924Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580088}
parent de64e7eb
...@@ -53,6 +53,9 @@ void UnifiedSliderBubbleController::CloseBubble() { ...@@ -53,6 +53,9 @@ void UnifiedSliderBubbleController::CloseBubble() {
slider_controller_.reset(); slider_controller_.reset();
if (!bubble_widget_) if (!bubble_widget_)
return; return;
// Ignore the request if the bubble is closing.
if (bubble_widget_->IsClosed())
return;
bubble_widget_->Close(); bubble_widget_->Close();
tray_->SetTrayBubbleHeight(0); tray_->SetTrayBubbleHeight(0);
} }
...@@ -104,6 +107,10 @@ void UnifiedSliderBubbleController::ShowBubble(SliderType slider_type) { ...@@ -104,6 +107,10 @@ void UnifiedSliderBubbleController::ShowBubble(SliderType slider_type) {
return; return;
} }
// Ignore the request if the bubble is closing.
if (bubble_widget_ && bubble_widget_->IsClosed())
return;
// If the bubble already exists, update the content of the bubble and extend // If the bubble already exists, update the content of the bubble and extend
// the autoclose timer. // the autoclose timer.
if (bubble_widget_) { if (bubble_widget_) {
......
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