| Index: chrome/browser/chromeos/display/output_protection_controller_ash.cc
|
| diff --git a/chrome/browser/chromeos/display/output_protection_controller_ash.cc b/chrome/browser/chromeos/display/output_protection_controller_ash.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9a7db154315445dbc49ef314d8b261012628e175
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/display/output_protection_controller_ash.cc
|
| @@ -0,0 +1,45 @@
|
| +// 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 "chrome/browser/chromeos/display/output_protection_controller_ash.h"
|
| +
|
| +#include "ash/shell.h"
|
| +
|
| +namespace chromeos {
|
| +
|
| +OutputProtectionControllerAsh::OutputProtectionControllerAsh()
|
| + : client_id_(ash::Shell::GetInstance()
|
| + ->display_configurator()
|
| + ->RegisterContentProtectionClient()) {}
|
| +
|
| +OutputProtectionControllerAsh::~OutputProtectionControllerAsh() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + if (client_id_ != display::DisplayConfigurator::INVALID_CLIENT_ID) {
|
| + display::DisplayConfigurator* configurator =
|
| + ash::Shell::GetInstance()->display_configurator();
|
| + configurator->UnregisterContentProtectionClient(client_id_);
|
| + }
|
| +}
|
| +
|
| +void OutputProtectionControllerAsh::QueryStatus(
|
| + int64_t display_id,
|
| + const OutputProtectionDelegate::QueryStatusCallback& callback) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + display::DisplayConfigurator* configurator =
|
| + ash::Shell::GetInstance()->display_configurator();
|
| + configurator->QueryContentProtectionStatus(client_id_, display_id, callback);
|
| +}
|
| +
|
| +void OutputProtectionControllerAsh::SetProtection(
|
| + int64_t display_id,
|
| + uint32_t desired_method_mask,
|
| + const OutputProtectionDelegate::SetProtectionCallback& callback) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + display::DisplayConfigurator* configurator =
|
| + ash::Shell::GetInstance()->display_configurator();
|
| + configurator->SetContentProtection(client_id_, display_id,
|
| + desired_method_mask, callback);
|
| +}
|
| +
|
| +} // namespace chromeos
|
|
|