Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1266)

Unified Diff: ui/display/chromeos/display_configurator.cc

Issue 584533002: Don't enable HDCP again if it is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/now_/current_/ Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/display/chromeos/display_configurator.cc
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc
index 19e122566e8412af5a1c2d3a5670a1acaeecf42e..08a58aa05ec3238a0bc895e9c92ddc8f4eff2212 100644
--- a/ui/display/chromeos/display_configurator.cc
+++ b/ui/display/chromeos/display_configurator.cc
@@ -251,12 +251,19 @@ bool DisplayConfigurator::ApplyProtections(const ContentProtections& requests) {
case DISPLAY_CONNECTION_TYPE_DISPLAYPORT:
case DISPLAY_CONNECTION_TYPE_DVI:
case DISPLAY_CONNECTION_TYPE_HDMI: {
- HDCPState new_desired_state =
- (all_desired & CONTENT_PROTECTION_METHOD_HDCP) ?
- HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED;
- if (!native_display_delegate_->SetHDCPState(*it->display,
- new_desired_state))
+ HDCPState current_state;
+ if (!native_display_delegate_->GetHDCPState(*it->display,
dnicoara 2014/09/19 15:57:53 Would you mind adding a comment here to explain wh
kcwu 2014/09/23 05:43:22 I am not sure what you mean. I added one more sent
dnicoara 2014/09/23 13:35:44 Awesome! I'm thinking something along the lines "N
kcwu 2014/09/24 14:57:44 Done.
+ &current_state))
return false;
+ bool current_desired = (current_state != HDCP_STATE_UNDESIRED);
+ bool new_desired = (all_desired & CONTENT_PROTECTION_METHOD_HDCP);
+ // Don't enable again if HDCP is already active.
+ if (current_desired != new_desired) {
+ HDCPState new_state =
+ new_desired ? HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED;
+ if (!native_display_delegate_->SetHDCPState(*it->display, new_state))
+ return false;
+ }
break;
}
case DISPLAY_CONNECTION_TYPE_INTERNAL:

Powered by Google App Engine
This is Rietveld 408576698