Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4168)

Unified Diff: ash/system/night_light/night_light_controller.cc

Issue 2969473004: [Night Light] CL11: Enhancements (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/settings/device_page/night_light_slider.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/night_light/night_light_controller.cc
diff --git a/ash/system/night_light/night_light_controller.cc b/ash/system/night_light/night_light_controller.cc
index e84b5ce1dfcfade5c86bde7d7f98e03094ee4ad1..8578c8c1850ecfb8050343c4679507f62ad039f7 100644
--- a/ash/system/night_light/night_light_controller.cc
+++ b/ash/system/night_light/night_light_controller.cc
@@ -30,11 +30,13 @@ constexpr float kDefaultColorTemperature = 0.5f;
// The duration of the temperature change animation for
// AnimationDurationType::kShort.
-constexpr int kManualAnimationDurationSec = 2;
+constexpr base::TimeDelta kManualAnimationDuration =
+ base::TimeDelta::FromSeconds(1);
// The duration of the temperature change animation for
// AnimationDurationType::kLong.
-constexpr int kAutomaticAnimationDurationSec = 20;
+constexpr base::TimeDelta kAutomaticAnimationDuration =
+ base::TimeDelta::FromSeconds(20);
class NightLightControllerDelegateImpl : public NightLightController::Delegate {
public:
@@ -259,12 +261,10 @@ void NightLightController::SetDelegateForTesting(
}
void NightLightController::RefreshLayersTemperature() {
- ApplyColorTemperatureToLayers(
- GetEnabled() ? GetColorTemperature() : 0.0f,
- base::TimeDelta::FromSeconds(animation_duration_ ==
- AnimationDuration::kShort
- ? kManualAnimationDurationSec
- : kAutomaticAnimationDurationSec));
+ ApplyColorTemperatureToLayers(GetEnabled() ? GetColorTemperature() : 0.0f,
+ animation_duration_ == AnimationDuration::kShort
+ ? kManualAnimationDuration
+ : kAutomaticAnimationDuration);
// Reset the animation type back to manual to consume any automatically set
// animations.
« no previous file with comments | « no previous file | chrome/browser/resources/settings/device_page/night_light_slider.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698