Chromium Code Reviews| Index: ui/display/chromeos/display_configurator.cc |
| diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc |
| index 1283b58a2b108b1180e020e83abc1169055d3e35..11fdfc22106ae3b4ccea6e4c4deaea00feaf2cdf 100644 |
| --- a/ui/display/chromeos/display_configurator.cc |
| +++ b/ui/display/chromeos/display_configurator.cc |
| @@ -221,15 +221,32 @@ void DisplayConfigurator::ForceInitialConfigure( |
| NotifyObservers(success, new_state); |
| } |
| +bool DisplayConfigurator::IsMirroring() const { |
| + return display_state_ == MULTIPLE_DISPLAY_STATE_DUAL_MIRROR || |
| + (mirroring_controller_ && |
|
Daniel Erat
2014/05/15 14:04:25
wrapped line should be indented four spaces, not t
kcwu
2014/05/16 04:36:39
Done.
|
| + mirroring_controller_->software_mirroring_enabled()); |
| +} |
| + |
| bool DisplayConfigurator::ApplyProtections(const ContentProtections& requests) { |
| for (DisplayStateList::const_iterator it = cached_displays_.begin(); |
| it != cached_displays_.end(); |
| ++it) { |
| uint32_t all_desired = 0; |
| - ContentProtections::const_iterator request_it = |
| - requests.find(it->display->display_id()); |
| - if (request_it != requests.end()) |
| - all_desired = request_it->second; |
| + |
| + // In mirror mode, protection request of all displays need to be fulfilled. |
| + // In non-mirror mode, only request of client's display needs to be |
| + // fulfilled. |
| + ContentProtections::const_iterator request_it; |
| + if (IsMirroring()) { |
| + for (request_it = requests.begin(); request_it != requests.end(); |
| + ++request_it) |
|
Daniel Erat
2014/05/15 14:04:25
fix indenting
kcwu
2014/05/16 04:36:39
Done.
|
| + all_desired |= request_it->second; |
| + } else { |
| + request_it = requests.find(it->display->display_id()); |
| + if (request_it != requests.end()) |
| + all_desired = request_it->second; |
| + } |
| + |
| switch (it->display->type()) { |
| case DISPLAY_CONNECTION_TYPE_UNKNOWN: |
| return false; |
| @@ -300,8 +317,11 @@ bool DisplayConfigurator::QueryContentProtectionStatus( |
| for (DisplayStateList::const_iterator it = cached_displays_.begin(); |
| it != cached_displays_.end(); |
| ++it) { |
| - if (it->display->display_id() != display_id) |
| + |
| + // Query display if it is in mirror mode or client on the same display. |
| + if (!IsMirroring() && it->display->display_id() != display_id) |
| continue; |
| + |
| *link_mask |= it->display->type(); |
| switch (it->display->type()) { |
| case DISPLAY_CONNECTION_TYPE_UNKNOWN: |