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..7687c108ec9deac96ce31bf6bd4e616eafefcc51 100644 |
| --- a/ui/display/chromeos/display_configurator.cc |
| +++ b/ui/display/chromeos/display_configurator.cc |
| @@ -221,15 +221,33 @@ void DisplayConfigurator::ForceInitialConfigure( |
| NotifyObservers(success, new_state); |
| } |
| +bool DisplayConfigurator::IsMirroring() const { |
| + return display_state_ == MULTIPLE_DISPLAY_STATE_DUAL_MIRROR || |
| + (mirroring_controller_ && |
| + mirroring_controller_->SoftwareMirroringEnabled()); |
|
Daniel Erat
2014/05/16 14:34:17
nit: is this what clang-format recommends? i think
kcwu1
2014/05/16 15:49:54
Done.
|
| +} |
| + |
| 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(); |
|
Daniel Erat
2014/05/16 14:34:17
nit: fix indenting (this and the next line should
kcwu1
2014/05/16 15:49:54
Done.
|
| + ++request_it) |
| + 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 +318,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: |