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

Unified Diff: chromeos/display/output_configurator.h

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 | « chromeos/dbus/power_manager_client.cc ('k') | chromeos/display/output_configurator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.h
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h
index 804f856b272e386560715dbfc40037eaa86f5722..4f93598d71fd2a76d26780c6aae370b7002a9f6f 100644
--- a/chromeos/display/output_configurator.h
+++ b/chromeos/display/output_configurator.h
@@ -14,6 +14,7 @@
#include "base/message_loop.h"
#include "base/timer.h"
#include "chromeos/chromeos_export.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
// Forward declarations for Xlib and Xrandr.
// This is so unused X definitions don't pollute the namespace.
@@ -86,7 +87,9 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// Called when powerd notifies us that some set of displays should be turned
// on or off. This requires enabling or disabling the CRTC associated with
// the display(s) in question so that the low power state is engaged.
- bool ScreenPowerSet(bool power_on, bool all_displays);
+ // If |force_probe| is true, the displays will be configured even if
+ // |power_state| matches |power_state_|.
+ bool SetDisplayPower(DisplayPowerState power_state, bool force_probe);
// Force switching the display mode to |new_state|. This method is used when
// the user explicitly changes the display mode in the options UI. Returns
@@ -106,11 +109,15 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// Tells if the output specified by |name| is for internal display.
static bool IsInternalOutputName(const std::string& name);
- // Set all the displays into pre-suspend mode; usually this means configure
- // them for their resume state. This allows faster resume on machines where
- // display configuration is slow.
+ // Sets all the displays into pre-suspend mode; usually this means
+ // configure them for their resume state. This allows faster resume on
+ // machines where display configuration is slow.
void SuspendDisplays();
+ // Reprobes displays to handle changes made while the system was
+ // suspended.
+ void ResumeDisplays();
+
private:
// Configure outputs.
void ConfigureOutputs();
@@ -156,15 +163,15 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
XRRScreenResources* screen,
std::vector<OutputSnapshot>& outputs);
- // Configures X to the state specified in |new_state|.
- // |display|, |screen| and |window| are used to change X configuration.
- // |new_state| is the state to enter.
- // |outputs| contains information on the currently configured state,
- // as well as how to apply the new state.
+ // Configures X to the state specified in |output_state| and
+ // |power_state|. |display|, |screen| and |window| are used to change X
+ // configuration. |outputs| contains information on the currently
+ // configured state, as well as how to apply the new state.
bool EnterState(Display* display,
XRRScreenResources* screen,
Window window,
- OutputState new_state,
+ OutputState output_state,
+ DisplayPowerState power_state,
const std::vector<OutputSnapshot>& outputs);
// Outputs UMA metrics of previous state (the state that is being left).
@@ -199,6 +206,9 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher {
// This is used for rotating display modes.
OutputState output_state_;
+ // The current power state as set via SetDisplayPower().
+ DisplayPowerState power_state_;
+
ObserverList<Observer> observers_;
// The timer to delay configuring outputs. See also the comments in
« no previous file with comments | « chromeos/dbus/power_manager_client.cc ('k') | chromeos/display/output_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698