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

Side by Side Diff: chromeos/display/output_configurator.h

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 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ 5 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ 6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/event_types.h" 11 #include "base/event_types.h"
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "base/timer.h" 15 #include "base/timer.h"
16 #include "chromeos/chromeos_export.h" 16 #include "chromeos/chromeos_export.h"
17 #include "third_party/cros_system_api/dbus/service_constants.h"
17 18
18 // Forward declarations for Xlib and Xrandr. 19 // Forward declarations for Xlib and Xrandr.
19 // This is so unused X definitions don't pollute the namespace. 20 // This is so unused X definitions don't pollute the namespace.
20 typedef unsigned long XID; 21 typedef unsigned long XID;
21 typedef XID Window; 22 typedef XID Window;
22 typedef XID RROutput; 23 typedef XID RROutput;
23 typedef XID RRCrtc; 24 typedef XID RRCrtc;
24 typedef XID RRMode; 25 typedef XID RRMode;
25 26
26 struct _XDisplay; 27 struct _XDisplay;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 void Init(bool is_panel_fitting_enabled, uint32 background_color_argb); 76 void Init(bool is_panel_fitting_enabled, uint32 background_color_argb);
76 77
77 // Called when the user hits ctrl-F4 to request a display mode change. 78 // Called when the user hits ctrl-F4 to request a display mode change.
78 // This method should only return false if it was called in a single-head or 79 // This method should only return false if it was called in a single-head or
79 // headless mode. 80 // headless mode.
80 bool CycleDisplayMode(); 81 bool CycleDisplayMode();
81 82
82 // Called when powerd notifies us that some set of displays should be turned 83 // Called when powerd notifies us that some set of displays should be turned
83 // on or off. This requires enabling or disabling the CRTC associated with 84 // on or off. This requires enabling or disabling the CRTC associated with
84 // the display(s) in question so that the low power state is engaged. 85 // the display(s) in question so that the low power state is engaged.
85 bool ScreenPowerSet(bool power_on, bool all_displays); 86 bool SetDisplayPowerState(DisplayPowerState state);
86 87
87 // Force switching the display mode to |new_state|. This method is used when 88 // Force switching the display mode to |new_state|. This method is used when
88 // the user explicitly changes the display mode in the options UI. Returns 89 // the user explicitly changes the display mode in the options UI. Returns
89 // false if it was called in a single-head or headless mode. 90 // false if it was called in a single-head or headless mode.
90 bool SetDisplayMode(OutputState new_state); 91 bool SetDisplayMode(OutputState new_state);
91 92
92 // Called when an RRNotify event is received. The implementation is 93 // Called when an RRNotify event is received. The implementation is
93 // interested in the cases of RRNotify events which correspond to output 94 // interested in the cases of RRNotify events which correspond to output
94 // add/remove events. Note that Output add/remove events are sent in response 95 // add/remove events. Note that Output add/remove events are sent in response
95 // to our own reconfiguration operations so spurious events are common. 96 // to our own reconfiguration operations so spurious events are common.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 211
211 // Indicates the time at which |output_state_| was entered. 212 // Indicates the time at which |output_state_| was entered.
212 base::TimeTicks last_enter_state_time_; 213 base::TimeTicks last_enter_state_time_;
213 214
214 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); 215 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator);
215 }; 216 };
216 217
217 } // namespace chromeos 218 } // namespace chromeos
218 219
219 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ 220 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698