Commit 30beb9cc authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Ignore brightness change less than threshold.

Previously, brightness change by slider less than the threshold was not
ignored in UnifiedSystemTray, which led to some artifacts (see the
video in the bug.)

TEST=manual
BUG=858948

Change-Id: I14dcbe6f02e0b35cb88b468421ca8416b9285dbe
Reviewed-on: https://chromium-review.googlesource.com/1124210Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572474}
parent a9c4186d
...@@ -37,13 +37,17 @@ void UnifiedBrightnessSliderController::SliderValueChanged( ...@@ -37,13 +37,17 @@ void UnifiedBrightnessSliderController::SliderValueChanged(
views::SliderChangeReason reason) { views::SliderChangeReason reason) {
if (reason != views::VALUE_CHANGED_BY_USER) if (reason != views::VALUE_CHANGED_BY_USER)
return; return;
BrightnessControlDelegate* brightness_control_delegate = BrightnessControlDelegate* brightness_control_delegate =
Shell::Get()->brightness_control_delegate(); Shell::Get()->brightness_control_delegate();
if (brightness_control_delegate) { if (!brightness_control_delegate)
double percent = return;
std::max<float>(value * 100.f, tray::kMinBrightnessPercent);
brightness_control_delegate->SetBrightnessPercent(percent, true); double percent = value * 100.;
} if (percent < tray::kMinBrightnessPercent)
return;
brightness_control_delegate->SetBrightnessPercent(percent, true);
} }
} // namespace ash } // namespace ash
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