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

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

Issue 10532053: Detect output state at startup to avoid changes (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address nit Created 8 years, 6 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
« no previous file with comments | « no previous file | chromeos/monitor/output_configurator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MONITOR_OUTPUT_CONFIGURATOR_H_ 5 #ifndef CHROMEOS_MONITOR_OUTPUT_CONFIGURATOR_H_
6 #define CHROMEOS_MONITOR_OUTPUT_CONFIGURATOR_H_ 6 #define CHROMEOS_MONITOR_OUTPUT_CONFIGURATOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/extensions/dpms.h> 10 #include <X11/extensions/dpms.h>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // A helper to re-cache instance variable state and transition into the 96 // A helper to re-cache instance variable state and transition into the
97 // appropriate default state for the observed displays. 97 // appropriate default state for the observed displays.
98 bool RecacheAndUseDefaultState(); 98 bool RecacheAndUseDefaultState();
99 99
100 // Checks the |primary_output_index_|, |secondary_output_index_|, and 100 // Checks the |primary_output_index_|, |secondary_output_index_|, and
101 // |mirror_supported_| to see how many displays are currently connected and 101 // |mirror_supported_| to see how many displays are currently connected and
102 // returns the state which is most appropriate as a default state for those 102 // returns the state which is most appropriate as a default state for those
103 // displays. 103 // displays.
104 State GetDefaultState() const; 104 State GetDefaultState() const;
105 105
106 // Called during start-up to determine what the current state of the displays
107 // appears to be, by investigating how the outputs compare to the data stored
108 // in |output_cache_|. Returns STATE_INVALID if the current display state
109 // doesn't match any supported state. |output_cache_| must be up-to-date with
110 // regards to the state of X or this method may return incorrect results.
111 State InferCurrentState(Display* display, XRRScreenResources* screen) const;
112
106 // This is detected by the constructor to determine whether or not we should 113 // This is detected by the constructor to determine whether or not we should
107 // be enabled. If we aren't running on ChromeOS, we can't assume that the 114 // be enabled. If we aren't running on ChromeOS, we can't assume that the
108 // Xrandr X11 extension is supported. 115 // Xrandr X11 extension is supported.
109 // If this flag is set to false, any attempts to change the output 116 // If this flag is set to false, any attempts to change the output
110 // configuration to immediately fail without changing the state. 117 // configuration to immediately fail without changing the state.
111 bool is_running_on_chrome_os_; 118 bool is_running_on_chrome_os_;
112 119
113 // The number of outputs in the output_cache_ array. 120 // The number of outputs in the output_cache_ array.
114 int output_count_; 121 int output_count_;
115 122
(...skipping 20 matching lines...) Expand all
136 // The display state as derived from the outputs observed in |output_cache_|. 143 // The display state as derived from the outputs observed in |output_cache_|.
137 // This is used for rotating display modes. 144 // This is used for rotating display modes.
138 State output_state_; 145 State output_state_;
139 146
140 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); 147 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator);
141 }; 148 };
142 149
143 } // namespace chromeos 150 } // namespace chromeos
144 151
145 #endif // CHROMEOS_MONITOR_OUTPUT_CONFIGURATOR_H_ 152 #endif // CHROMEOS_MONITOR_OUTPUT_CONFIGURATOR_H_
OLDNEW
« no previous file with comments | « no previous file | chromeos/monitor/output_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698