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

Unified Diff: ui/display/chromeos/display_configurator.cc

Issue 932203002: Move check for suspended displays out of common path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check that SetDisplayPower and SetDisplayMode still work Created 5 years, 10 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 | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/display_configurator.cc
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc
index bcfc46ad22790ef5415dbfe310e2249b76a10f7d..a6eb35f43963fcefea165a99cfcb387cdafed8b5 100644
--- a/ui/display/chromeos/display_configurator.cc
+++ b/ui/display/chromeos/display_configurator.cc
@@ -814,6 +814,14 @@ void DisplayConfigurator::SetDisplayMode(MultipleDisplayState new_state) {
}
void DisplayConfigurator::OnConfigurationChanged() {
+ // Don't do anything if the displays are currently suspended. Instead we will
+ // probe and reconfigure the displays if necessary in ResumeDisplays().
+ if (displays_suspended_) {
+ VLOG(1) << "Displays are currently suspended. Not attempting to "
+ << "reconfigure them.";
+ return;
+ }
+
// Configure displays with |kConfigureDelayMs| delay,
// so that time-consuming ConfigureDisplays() won't be called multiple times.
if (configure_timer_.IsRunning()) {
@@ -859,6 +867,10 @@ void DisplayConfigurator::SuspendDisplays() {
}
displays_suspended_ = true;
+
+ // Stop |configure_timer_| because we will force probe and configure all the
+ // displays at resume time anyway.
+ configure_timer_.Stop();
}
void DisplayConfigurator::ResumeDisplays() {
@@ -880,14 +892,6 @@ void DisplayConfigurator::ConfigureDisplays() {
}
void DisplayConfigurator::RunPendingConfiguration() {
- // Don't do anything if the displays are currently suspended. Instead we will
- // probe and reconfigure the displays if necessary in ResumeDisplays().
- if (displays_suspended_) {
- VLOG(1) << "Displays are currently suspended. Not attempting to "
- << "reconfigure them.";
- return;
- }
-
// Configuration task is currently running. Do not start a second
// configuration.
if (configuration_task_)
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698