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..84b375db8997da59b51170c31e14b96944a7023d 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()); |
+} |
+ |
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) |
+ 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,10 @@ 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: |