OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 5 #ifndef UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // See crbug.com/130188 for initial discussion. | 165 // See crbug.com/130188 for initial discussion. |
166 static const int kVerticalGap = 60; | 166 static const int kVerticalGap = 60; |
167 | 167 |
168 // Returns the mode within |display| that matches the given size with highest | 168 // Returns the mode within |display| that matches the given size with highest |
169 // refresh rate. Returns None if no matching display was found. | 169 // refresh rate. Returns None if no matching display was found. |
170 static const DisplayMode* FindDisplayModeMatchingSize( | 170 static const DisplayMode* FindDisplayModeMatchingSize( |
171 const DisplaySnapshot& display, | 171 const DisplaySnapshot& display, |
172 const gfx::Size& size); | 172 const gfx::Size& size); |
173 | 173 |
174 DisplayConfigurator(); | 174 DisplayConfigurator(); |
175 virtual ~DisplayConfigurator(); | 175 ~DisplayConfigurator() override; |
176 | 176 |
177 MultipleDisplayState display_state() const { return current_display_state_; } | 177 MultipleDisplayState display_state() const { return current_display_state_; } |
178 chromeos::DisplayPowerState requested_power_state() const { | 178 chromeos::DisplayPowerState requested_power_state() const { |
179 return requested_power_state_; | 179 return requested_power_state_; |
180 } | 180 } |
181 const gfx::Size framebuffer_size() const { return framebuffer_size_; } | 181 const gfx::Size framebuffer_size() const { return framebuffer_size_; } |
182 const std::vector<DisplayState>& cached_displays() const { | 182 const std::vector<DisplayState>& cached_displays() const { |
183 return cached_displays_; | 183 return cached_displays_; |
184 } | 184 } |
185 | 185 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // |flags| contains bitwise-or-ed kSetDisplayPower* values. Returns true if | 225 // |flags| contains bitwise-or-ed kSetDisplayPower* values. Returns true if |
226 // the system successfully enters (or was already in) |power_state|. | 226 // the system successfully enters (or was already in) |power_state|. |
227 void SetDisplayPower(chromeos::DisplayPowerState power_state, int flags); | 227 void SetDisplayPower(chromeos::DisplayPowerState power_state, int flags); |
228 | 228 |
229 // Force switching the display mode to |new_state|. Returns false if | 229 // Force switching the display mode to |new_state|. Returns false if |
230 // switching failed (possibly because |new_state| is invalid for the | 230 // switching failed (possibly because |new_state| is invalid for the |
231 // current set of connected displays). | 231 // current set of connected displays). |
232 void SetDisplayMode(MultipleDisplayState new_state); | 232 void SetDisplayMode(MultipleDisplayState new_state); |
233 | 233 |
234 // NativeDisplayDelegate::Observer overrides: | 234 // NativeDisplayDelegate::Observer overrides: |
235 virtual void OnConfigurationChanged() override; | 235 void OnConfigurationChanged() override; |
236 | 236 |
237 void AddObserver(Observer* observer); | 237 void AddObserver(Observer* observer); |
238 void RemoveObserver(Observer* observer); | 238 void RemoveObserver(Observer* observer); |
239 | 239 |
240 // Sets all the displays into pre-suspend mode; usually this means | 240 // Sets all the displays into pre-suspend mode; usually this means |
241 // configure them for their resume state. This allows faster resume on | 241 // configure them for their resume state. This allows faster resume on |
242 // machines where display configuration is slow. | 242 // machines where display configuration is slow. |
243 void SuspendDisplays(); | 243 void SuspendDisplays(); |
244 | 244 |
245 // Reprobes displays to handle changes made while the system was | 245 // Reprobes displays to handle changes made while the system was |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 399 |
400 // This must be the last variable. | 400 // This must be the last variable. |
401 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; | 401 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; |
402 | 402 |
403 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 403 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
404 }; | 404 }; |
405 | 405 |
406 } // namespace ui | 406 } // namespace ui |
407 | 407 |
408 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 408 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
OLD | NEW |