Chromium Code Reviews| Index: services/ui/display/output_protection.cc |
| diff --git a/services/ui/display/output_protection.cc b/services/ui/display/output_protection.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2e7b53908c37bd362f07f0bb1b715ae7bf621078 |
| --- /dev/null |
| +++ b/services/ui/display/output_protection.cc |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "services/ui/display/output_protection.h" |
| + |
| +#include "ui/display/manager/chromeos/display_configurator.h" |
| + |
| +namespace display { |
| + |
| +OutputProtection::OutputProtection(DisplayConfigurator* display_configurator) |
| + : display_configurator_(display_configurator), |
| + client_id_(display_configurator_->RegisterContentProtectionClient()) {} |
| + |
| +OutputProtection::~OutputProtection() { |
| + display_configurator_->UnregisterContentProtectionClient(client_id_); |
|
sky
2017/02/10 19:24:56
Does unregister automatically revert?
Peng
2017/02/10 20:35:47
I checked the code of DisplayConfigurator. Seems t
kcwu
2017/02/11 01:45:21
Yes, your understanding is correct.
|
| +} |
| + |
| +void OutputProtection::QueryContentProtectionStatus( |
| + int64_t display_id, |
| + const QueryContentProtectionStatusCallback& callback) { |
| + display_configurator_->QueryContentProtectionStatus(client_id_, display_id, |
| + callback); |
| +} |
| + |
| +void OutputProtection::EnableContentProtection( |
| + int64_t display_id, |
| + uint32_t desired_method_mask, |
| + const EnableContentProtectionCallback& callback) { |
| + display_configurator_->EnableContentProtection(client_id_, display_id, |
| + desired_method_mask, callback); |
| +} |
| + |
| +} // namespace display |