Index: ui/display/chromeos/display_configurator.cc |
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc |
index a32fd0b82197d737718efb64aa402d4c8ef222f2..3194636b6279e587c57dae75ef662c0f8e2c7e14 100644 |
--- a/ui/display/chromeos/display_configurator.cc |
+++ b/ui/display/chromeos/display_configurator.cc |
@@ -517,9 +517,10 @@ void DisplayConfigurator::OnConfigurationChanged() { |
// so that time-consuming ConfigureDisplays() won't be called multiple times. |
if (configure_timer_.IsRunning()) { |
// Note: when the timer is running it is possible that a different task |
- // (SetDisplayPower()) is scheduled. In these cases, prefer the already |
- // scheduled task to ConfigureDisplays() since ConfigureDisplays() performs |
- // only basic configuration while SetDisplayPower() will perform additional |
+ // (RestoreRequestedPowerStateAfterResume()) is scheduled. In these cases, |
+ // prefer the already scheduled task to ConfigureDisplays() since |
+ // ConfigureDisplays() performs only basic configuration while |
+ // RestoreRequestedPowerStateAfterResume() will perform additional |
// operations. |
configure_timer_.Reset(); |
} else { |
@@ -557,15 +558,11 @@ void DisplayConfigurator::SuspendDisplays() { |
} |
void DisplayConfigurator::ResumeDisplays() { |
- // Force probing to ensure that we pick up any changes that were made |
- // while the system was suspended. |
configure_timer_.Start( |
FROM_HERE, |
base::TimeDelta::FromMilliseconds(kResumeDelayMs), |
- base::Bind(base::IgnoreResult(&DisplayConfigurator::SetDisplayPower), |
- base::Unretained(this), |
- requested_power_state_, |
- kSetDisplayPowerForceProbe)); |
+ base::Bind(&DisplayConfigurator::RestoreRequestedPowerStateAfterResume, |
+ base::Unretained(this))); |
} |
void DisplayConfigurator::UpdateCachedDisplays() { |
@@ -725,6 +722,12 @@ void DisplayConfigurator::ConfigureDisplays() { |
NotifyObservers(success, new_state); |
} |
+void DisplayConfigurator::RestoreRequestedPowerStateAfterResume() { |
+ // Force probing to ensure that we pick up any changes that were made while |
+ // the system was suspended. |
+ SetDisplayPower(requested_power_state_, kSetDisplayPowerForceProbe); |
+} |
+ |
void DisplayConfigurator::NotifyObservers( |
bool success, |
MultipleDisplayState attempted_state) { |