OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/display/chromeos/display_configurator.h" | 5 #include "ui/display/chromeos/display_configurator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 all_desired = request_it->second; | 244 all_desired = request_it->second; |
245 } | 245 } |
246 | 246 |
247 switch (it->display->type()) { | 247 switch (it->display->type()) { |
248 case DISPLAY_CONNECTION_TYPE_UNKNOWN: | 248 case DISPLAY_CONNECTION_TYPE_UNKNOWN: |
249 return false; | 249 return false; |
250 // DisplayPort, DVI, and HDMI all support HDCP. | 250 // DisplayPort, DVI, and HDMI all support HDCP. |
251 case DISPLAY_CONNECTION_TYPE_DISPLAYPORT: | 251 case DISPLAY_CONNECTION_TYPE_DISPLAYPORT: |
252 case DISPLAY_CONNECTION_TYPE_DVI: | 252 case DISPLAY_CONNECTION_TYPE_DVI: |
253 case DISPLAY_CONNECTION_TYPE_HDMI: { | 253 case DISPLAY_CONNECTION_TYPE_HDMI: { |
254 HDCPState new_desired_state = | 254 HDCPState current_state; |
255 (all_desired & CONTENT_PROTECTION_METHOD_HDCP) ? | 255 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.
| |
256 HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED; | 256 ¤t_state)) |
257 if (!native_display_delegate_->SetHDCPState(*it->display, | |
258 new_desired_state)) | |
259 return false; | 257 return false; |
258 bool current_desired = (current_state != HDCP_STATE_UNDESIRED); | |
259 bool new_desired = (all_desired & CONTENT_PROTECTION_METHOD_HDCP); | |
260 // Don't enable again if HDCP is already active. | |
261 if (current_desired != new_desired) { | |
262 HDCPState new_state = | |
263 new_desired ? HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED; | |
264 if (!native_display_delegate_->SetHDCPState(*it->display, new_state)) | |
265 return false; | |
266 } | |
260 break; | 267 break; |
261 } | 268 } |
262 case DISPLAY_CONNECTION_TYPE_INTERNAL: | 269 case DISPLAY_CONNECTION_TYPE_INTERNAL: |
263 case DISPLAY_CONNECTION_TYPE_VGA: | 270 case DISPLAY_CONNECTION_TYPE_VGA: |
264 case DISPLAY_CONNECTION_TYPE_NETWORK: | 271 case DISPLAY_CONNECTION_TYPE_NETWORK: |
265 // No protections for these types. Do nothing. | 272 // No protections for these types. Do nothing. |
266 break; | 273 break; |
267 case DISPLAY_CONNECTION_TYPE_NONE: | 274 case DISPLAY_CONNECTION_TYPE_NONE: |
268 NOTREACHED(); | 275 NOTREACHED(); |
269 break; | 276 break; |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
949 return state_controller_->GetStateForDisplayIds(display_ids); | 956 return state_controller_->GetStateForDisplayIds(display_ids); |
950 } | 957 } |
951 } | 958 } |
952 default: | 959 default: |
953 NOTREACHED(); | 960 NOTREACHED(); |
954 } | 961 } |
955 return MULTIPLE_DISPLAY_STATE_INVALID; | 962 return MULTIPLE_DISPLAY_STATE_INVALID; |
956 } | 963 } |
957 | 964 |
958 } // namespace ui | 965 } // namespace ui |
OLD | NEW |