| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/display/output_protection_controller_ash.h" |
| 6 |
| 7 #include "ash/shell.h" |
| 8 |
| 9 namespace chromeos { |
| 10 |
| 11 OutputProtectionControllerAsh::OutputProtectionControllerAsh() |
| 12 : client_id_(ash::Shell::GetInstance() |
| 13 ->display_configurator() |
| 14 ->RegisterContentProtectionClient()) {} |
| 15 |
| 16 OutputProtectionControllerAsh::~OutputProtectionControllerAsh() { |
| 17 DCHECK(thread_checker_.CalledOnValidThread()); |
| 18 if (client_id_ != display::DisplayConfigurator::INVALID_CLIENT_ID) { |
| 19 display::DisplayConfigurator* configurator = |
| 20 ash::Shell::GetInstance()->display_configurator(); |
| 21 configurator->UnregisterContentProtectionClient(client_id_); |
| 22 } |
| 23 } |
| 24 |
| 25 void OutputProtectionControllerAsh::QueryStatus( |
| 26 int64_t display_id, |
| 27 const OutputProtectionDelegate::QueryStatusCallback& callback) { |
| 28 DCHECK(thread_checker_.CalledOnValidThread()); |
| 29 display::DisplayConfigurator* configurator = |
| 30 ash::Shell::GetInstance()->display_configurator(); |
| 31 configurator->QueryContentProtectionStatus(client_id_, display_id, callback); |
| 32 } |
| 33 |
| 34 void OutputProtectionControllerAsh::SetProtection( |
| 35 int64_t display_id, |
| 36 uint32_t desired_method_mask, |
| 37 const OutputProtectionDelegate::SetProtectionCallback& callback) { |
| 38 DCHECK(thread_checker_.CalledOnValidThread()); |
| 39 display::DisplayConfigurator* configurator = |
| 40 ash::Shell::GetInstance()->display_configurator(); |
| 41 configurator->SetContentProtection(client_id_, display_id, |
| 42 desired_method_mask, callback); |
| 43 } |
| 44 |
| 45 } // namespace chromeos |
| OLD | NEW |