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

Unified Diff: chrome/browser/chromeos/power/output_observer.cc

Issue 12391004: chromeos: Add DisplayPowerServiceProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ugh, TrayDisplay was including output_configurator.h on windows Created 7 years, 9 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 | « chrome/browser/chromeos/power/output_observer.h ('k') | chrome/browser/chromeos/power/resume_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/power/output_observer.cc
diff --git a/chrome/browser/chromeos/power/output_observer.cc b/chrome/browser/chromeos/power/output_observer.cc
index 24e573e1cbd088d5a69da291b1889b3699025802..0cbe05dd397876be354b567e5e7a00d9ae395883 100644
--- a/chrome/browser/chromeos/power/output_observer.cc
+++ b/chrome/browser/chromeos/power/output_observer.cc
@@ -20,16 +20,24 @@ OutputObserver::~OutputObserver() {
}
void OutputObserver::ScreenPowerSet(bool power_on, bool all_displays) {
- if (!power_on && all_displays) {
- // All displays are turned off when the device becomes idle, which
- // may trigger a mouse move. Let the UserActivityDetector know so
- // that it can ignore such events.
- ash::Shell::GetInstance()->user_activity_detector()->
- OnAllOutputsTurnedOff();
- }
-
- ash::Shell::GetInstance()->output_configurator()->
- ScreenPowerSet(power_on, all_displays);
+ // Turning displays off when the device becomes idle or on just before we
+ // suspend may trigger a mouse move, which would then be incorrectly
+ // reported as user activity. Let the UserActivityDetector know so that
+ // it can ignore such events.
+ ash::Shell::GetInstance()->user_activity_detector()->OnDisplayPowerChanging();
+
+ DisplayPowerState state = DISPLAY_POWER_ALL_ON;
+ if (power_on && all_displays)
+ state = DISPLAY_POWER_ALL_ON;
+ else if (power_on && !all_displays)
+ state = DISPLAY_POWER_INTERNAL_ON_EXTERNAL_OFF;
+ else if (!power_on && all_displays)
+ state = DISPLAY_POWER_ALL_OFF;
+ else if (!power_on && !all_displays)
+ state = DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON;
+
+ ash::Shell::GetInstance()->output_configurator()->SetDisplayPower(
+ state, false);
}
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/power/output_observer.h ('k') | chrome/browser/chromeos/power/resume_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698