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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 now_state;
Daniel Erat 2014/09/18 14:45:30 nit: current_state
kcwu 2014/09/19 04:39:14 Done.
255 (all_desired & CONTENT_PROTECTION_METHOD_HDCP) ? 255 if (!native_display_delegate_->GetHDCPState(*it->display, &now_state))
Daniel Erat 2014/09/18 14:45:30 does this trigger a slow probe of the display?
dnicoara 2014/09/18 15:39:16 crbug.com/374465 tracked an issue where GetHDCP wa
kcwu 2014/09/19 04:39:14 The driver is fixed. See comment #2 in crbug/41284
256 HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED;
257 if (!native_display_delegate_->SetHDCPState(*it->display,
258 new_desired_state))
259 return false; 256 return false;
257 bool now_desired = (now_state != HDCP_STATE_UNDESIRED);
Daniel Erat 2014/09/18 14:45:30 nit: s/now/current/; "new" and "now" look too simi
kcwu 2014/09/19 04:39:15 Done.
258 bool new_desired = (all_desired & CONTENT_PROTECTION_METHOD_HDCP);
259 // Don't enable again if HDCP is already active.
260 if (now_desired != new_desired) {
261 HDCPState new_state =
262 new_desired ? HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED;
263 if (!native_display_delegate_->SetHDCPState(*it->display, new_state))
264 return false;
265 }
260 break; 266 break;
261 } 267 }
262 case DISPLAY_CONNECTION_TYPE_INTERNAL: 268 case DISPLAY_CONNECTION_TYPE_INTERNAL:
263 case DISPLAY_CONNECTION_TYPE_VGA: 269 case DISPLAY_CONNECTION_TYPE_VGA:
264 case DISPLAY_CONNECTION_TYPE_NETWORK: 270 case DISPLAY_CONNECTION_TYPE_NETWORK:
265 // No protections for these types. Do nothing. 271 // No protections for these types. Do nothing.
266 break; 272 break;
267 case DISPLAY_CONNECTION_TYPE_NONE: 273 case DISPLAY_CONNECTION_TYPE_NONE:
268 NOTREACHED(); 274 NOTREACHED();
269 break; 275 break;
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 return state_controller_->GetStateForDisplayIds(display_ids); 955 return state_controller_->GetStateForDisplayIds(display_ids);
950 } 956 }
951 } 957 }
952 default: 958 default:
953 NOTREACHED(); 959 NOTREACHED();
954 } 960 }
955 return MULTIPLE_DISPLAY_STATE_INVALID; 961 return MULTIPLE_DISPLAY_STATE_INVALID;
956 } 962 }
957 963
958 } // namespace ui 964 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698