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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/power/output_observer.h" 5 #include "chrome/browser/chromeos/power/output_observer.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/user_activity_detector.h" 8 #include "ash/wm/user_activity_detector.h"
9 #include "chromeos/dbus/dbus_thread_manager.h" 9 #include "chromeos/dbus/dbus_thread_manager.h"
10 #include "chromeos/display/output_configurator.h" 10 #include "chromeos/display/output_configurator.h"
(...skipping 10 matching lines...) Expand all
21 21
22 void OutputObserver::ScreenPowerSet(bool power_on, bool all_displays) { 22 void OutputObserver::ScreenPowerSet(bool power_on, bool all_displays) {
23 if (!power_on && all_displays) { 23 if (!power_on && all_displays) {
24 // All displays are turned off when the device becomes idle, which 24 // All displays are turned off when the device becomes idle, which
25 // may trigger a mouse move. Let the UserActivityDetector know so 25 // may trigger a mouse move. Let the UserActivityDetector know so
26 // that it can ignore such events. 26 // that it can ignore such events.
27 ash::Shell::GetInstance()->user_activity_detector()-> 27 ash::Shell::GetInstance()->user_activity_detector()->
28 OnAllOutputsTurnedOff(); 28 OnAllOutputsTurnedOff();
29 } 29 }
30 30
31 ash::Shell::GetInstance()->output_configurator()-> 31 DisplayPowerState state = DISPLAY_POWER_ALL_ON;
32 ScreenPowerSet(power_on, all_displays); 32 if (power_on)
33 state = DISPLAY_POWER_ALL_ON;
34 else if (!power_on && all_displays)
35 state = DISPLAY_POWER_ALL_OFF;
36 else if (!power_on && !all_displays)
37 state = DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON;
38
39 ash::Shell::GetInstance()->output_configurator()->SetDisplayPowerState(state);
33 } 40 }
34 41
35 } // namespace chromeos 42 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698