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

Unified Diff: chromeos/display/output_configurator.cc

Issue 22875019: chromeos: Notify observers after display power changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | chromeos/display/output_configurator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index c8de844520115706277f8a20a5eeae159a3ff983..7aa594d7221196c2c76e87f67709e161d2b277e8 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -242,20 +242,24 @@ bool OutputConfigurator::SetDisplayPower(DisplayPowerState power_state,
std::vector<OutputSnapshot> outputs =
delegate_->GetOutputs(state_controller_);
+ bool changed = false;
bool only_if_single_internal_display =
flags & kSetDisplayPowerOnlyIfSingleInternalDisplay;
bool single_internal_display = outputs.size() == 1 && outputs[0].is_internal;
if ((single_internal_display || !only_if_single_internal_display) &&
EnterStateOrFallBackToSoftwareMirroring(
GetOutputState(outputs, power_state), power_state, outputs)) {
- if (power_state != DISPLAY_POWER_ALL_OFF) {
- // Force the DPMS on since the driver doesn't always detect that it
- // should turn on. This is needed when coming back from idle suspend.
+ // Force the DPMS on since the driver doesn't always detect that it
+ // should turn on. This is needed when coming back from idle suspend.
+ if (power_state != DISPLAY_POWER_ALL_OFF)
delegate_->ForceDPMSOn();
- }
+
+ changed = true;
}
delegate_->UngrabServer();
+ if (changed)
+ NotifyOnDisplayChanged();
Daniel Erat 2013/08/16 00:51:46 I don't think that we need to notify about failure
return true;
}
« no previous file with comments | « no previous file | chromeos/display/output_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698