Chromium Code Reviews| Index: ui/display/chromeos/display_configurator.h |
| diff --git a/ui/display/chromeos/display_configurator.h b/ui/display/chromeos/display_configurator.h |
| index 9fa5b41b987fccc7c31d10713fcacbf0944b6d8b..01ecf43d1dce6634f84a8b0d22a2c34df16caf00 100644 |
| --- a/ui/display/chromeos/display_configurator.h |
| +++ b/ui/display/chromeos/display_configurator.h |
| @@ -158,6 +158,16 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { |
| // See crbug.com/130188 for initial discussion. |
| static const int kVerticalGap = 60; |
| + // The delay to perform configuration after RRNotify. See the comment for |
| + // |configure_timer_|. |
| + static const int kConfigureDelayMs = 500; |
| + |
| + // The delay to perform configuration after waking up from suspend when in |
| + // multi display mode. Should be bigger than |kConfigureDelayMs|. Generally |
| + // big enough for external displays to be detected and added. |
| + // crbug.com/614624. |
| + static const int kResumeConfigureMultiDisplayDelayMs = 2000; |
| + |
| // Returns the mode within |display| that matches the given size with highest |
| // refresh rate. Returns None if no matching display was found. |
| static const DisplayMode* FindDisplayModeMatchingSize( |
| @@ -175,6 +185,18 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { |
| const std::vector<DisplaySnapshot*>& cached_displays() const { |
| return cached_displays_; |
| } |
| + void set_state_controller(StateController* controller) { |
| + state_controller_ = controller; |
| + } |
| + void set_mirroring_controller(SoftwareMirroringController* controller) { |
| + mirroring_controller_ = controller; |
| + } |
| + void set_configure_display(bool configure_display) { |
| + configure_display_ = configure_display; |
| + } |
| + chromeos::DisplayPowerState current_power_state() const { |
| + return current_power_state_; |
| + } |
| // Called when an external process no longer needs to control the display |
| // and Chrome can take control. |
| @@ -184,13 +206,6 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { |
| // Chrome should relinquish it. |
| void RelinquishControl(const DisplayControlCallback& callback); |
| - void set_state_controller(StateController* controller) { |
| - state_controller_ = controller; |
| - } |
| - void set_mirroring_controller(SoftwareMirroringController* controller) { |
| - mirroring_controller_ = controller; |
| - } |
| - |
| // Replaces |native_display_delegate_| with the delegate passed in and sets |
| // |configure_display_| to true. Should be called before Init(). |
| void SetDelegateForTesting( |
| @@ -241,8 +256,10 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { |
| void SuspendDisplays(const ConfigurationCallback& callback); |
| // Reprobes displays to handle changes made while the system was |
| - // suspended. |
| + // suspended. ResumeDisplaysWithCallback() invokes |callback| when display |
| + // configuration is complete. |
| void ResumeDisplays(); |
| + void ResumeDisplaysWithCallback(const ConfigurationCallback& callback); |
|
Daniel Erat
2016/10/24 16:31:04
instead of having two methods, please just make Re
afakhry
2016/10/25 00:37:10
Done.
base::DoNothing() won't work though, it's
|
| // Registers a client for display protection and requests a client id. Returns |
| // 0 if requesting failed. |
| @@ -282,10 +299,6 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { |
| // Returns true if there is at least one display on. |
| bool IsDisplayOn() const; |
| - void set_configure_display(bool configure_display) { |
| - configure_display_ = configure_display; |
| - } |
| - |
| // Sets the gamma, degamma and correction matrix for |display_id| to the |
| // values in |degamma_lut|, |gamma_lut| and |correction_matrix|. |
| bool SetColorCorrection(int64_t display_id, |