| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Replaces |native_display_delegate_| with the delegate passed in and sets | 194 // Replaces |native_display_delegate_| with the delegate passed in and sets |
| 195 // |configure_display_| to true. Should be called before Init(). | 195 // |configure_display_| to true. Should be called before Init(). |
| 196 void SetDelegateForTesting( | 196 void SetDelegateForTesting( |
| 197 std::unique_ptr<NativeDisplayDelegate> display_delegate); | 197 std::unique_ptr<NativeDisplayDelegate> display_delegate); |
| 198 | 198 |
| 199 // Sets the initial value of |power_state_|. Must be called before Start(). | 199 // Sets the initial value of |power_state_|. Must be called before Start(). |
| 200 void SetInitialDisplayPower(chromeos::DisplayPowerState power_state); | 200 void SetInitialDisplayPower(chromeos::DisplayPowerState power_state); |
| 201 | 201 |
| 202 // Initialization, must be called right after constructor. | 202 // Initialization, must be called right after constructor. |
| 203 // |is_panel_fitting_enabled| indicates hardware panel fitting support. | 203 // |is_panel_fitting_enabled| indicates hardware panel fitting support. |
| 204 void Init(bool is_panel_fitting_enabled); | 204 void Init(std::unique_ptr<NativeDisplayDelegate> delegate, |
| 205 bool is_panel_fitting_enabled); |
| 205 | 206 |
| 206 // Does initial configuration of displays during startup. | 207 // Does initial configuration of displays during startup. |
| 207 // If |background_color_argb| is non zero and there are multiple displays, | 208 // If |background_color_argb| is non zero and there are multiple displays, |
| 208 // DisplayConfigurator sets the background color of X's RootWindow to this | 209 // DisplayConfigurator sets the background color of X's RootWindow to this |
| 209 // color. | 210 // color. |
| 210 void ForceInitialConfigure(uint32_t background_color_argb); | 211 void ForceInitialConfigure(uint32_t background_color_argb); |
| 211 | 212 |
| 212 // Stop handling display configuration events/requests. | 213 // Stop handling display configuration events/requests. |
| 213 void PrepareForExit(); | 214 void PrepareForExit(); |
| 214 | 215 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 const std::vector<GammaRampRGBEntry>& gamma_lut, | 293 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 293 const std::vector<float>& correction_matrix); | 294 const std::vector<float>& correction_matrix); |
| 294 | 295 |
| 295 private: | 296 private: |
| 296 class DisplayLayoutManagerImpl; | 297 class DisplayLayoutManagerImpl; |
| 297 | 298 |
| 298 // Mapping a client to its protection request. | 299 // Mapping a client to its protection request. |
| 299 typedef std::map<ContentProtectionClientId, ContentProtections> | 300 typedef std::map<ContentProtectionClientId, ContentProtections> |
| 300 ProtectionRequests; | 301 ProtectionRequests; |
| 301 | 302 |
| 302 // Performs platform specific delegate initialization. | |
| 303 std::unique_ptr<NativeDisplayDelegate> CreatePlatformNativeDisplayDelegate(); | |
| 304 | |
| 305 // Configures displays. Invoked by |configure_timer_|. | 303 // Configures displays. Invoked by |configure_timer_|. |
| 306 void ConfigureDisplays(); | 304 void ConfigureDisplays(); |
| 307 | 305 |
| 308 // Restores |requested_power_state_| after the system has resumed, | 306 // Restores |requested_power_state_| after the system has resumed, |
| 309 // additionally forcing a probe. Invoked by |configure_timer_|. | 307 // additionally forcing a probe. Invoked by |configure_timer_|. |
| 310 void RestoreRequestedPowerStateAfterResume(); | 308 void RestoreRequestedPowerStateAfterResume(); |
| 311 | 309 |
| 312 // Notifies observers about an attempted state change. | 310 // Notifies observers about an attempted state change. |
| 313 void NotifyDisplayStateObservers(bool success, | 311 void NotifyDisplayStateObservers(bool success, |
| 314 MultipleDisplayState attempted_state); | 312 MultipleDisplayState attempted_state); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 458 |
| 461 // This must be the last variable. | 459 // This must be the last variable. |
| 462 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; | 460 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; |
| 463 | 461 |
| 464 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 462 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
| 465 }; | 463 }; |
| 466 | 464 |
| 467 } // namespace ui | 465 } // namespace ui |
| 468 | 466 |
| 469 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 467 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
| OLD | NEW |