Chromium Code Reviews| Index: chromeos/display/output_configurator.cc |
| diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc |
| index 4f0d3cdb4f6b2f4b80823dbb7bfeecdc13e6b35c..1d3846643530e37bf98d934f1010715f2849d1f5 100644 |
| --- a/chromeos/display/output_configurator.cc |
| +++ b/chromeos/display/output_configurator.cc |
| @@ -227,7 +227,8 @@ OutputConfigurator::OutputConfigurator() |
| configure_display_(base::chromeos::IsRunningOnChromeOS()), |
| xrandr_event_base_(0), |
| output_state_(STATE_INVALID), |
| - power_state_(DISPLAY_POWER_ALL_ON) { |
| + power_state_(DISPLAY_POWER_ALL_ON), |
| + next_output_protection_client_id_(1) { |
| } |
| OutputConfigurator::~OutputConfigurator() {} |
| @@ -273,6 +274,44 @@ void OutputConfigurator::Start(uint32 background_color_argb) { |
| NotifyObservers(success, new_state); |
| } |
| +OutputConfigurator::OutputProtectionClientId |
| +OutputConfigurator::RegisterOutputProtectionClient() { |
| + if (!configure_display_) |
| + return 0; |
| + |
| + return next_output_protection_client_id_++; |
| +} |
| + |
| +void OutputConfigurator::UnregisterOutputProtectionClient( |
| + OutputProtectionClientId client_id) { |
| + EnableOutputProtection(client_id, OUTPUT_PROTECTION_METHOD_NONE); |
| +} |
| + |
| +bool OutputConfigurator::QueryOutputProtectionStatus( |
| + OutputProtectionClientId client_id, |
| + uint32_t* link_mask, |
| + uint32_t* protection_mask) { |
| + if (!configure_display_) |
| + return false; |
| + |
| + bool result = delegate_->QueryOutputProtectionStatus(client_id, link_mask, |
| + protection_mask); |
| + return result; |
|
Daniel Erat
2013/09/20 15:00:24
just do:
return delegate_->Query...
kcwu
2013/09/20 20:29:30
Done.
|
| +} |
| + |
| +bool OutputConfigurator::EnableOutputProtection( |
| + OutputProtectionClientId client_id, |
| + uint32_t desired_method_mask) { |
| + if (!configure_display_) |
| + return false; |
| + |
| + delegate_->GrabServer(); |
| + bool result = delegate_->EnableOutputProtection(client_id, |
| + desired_method_mask); |
| + delegate_->UngrabServer(); |
| + return result; |
| +} |
| + |
| void OutputConfigurator::Stop() { |
| configure_display_ = false; |
| } |