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

Unified Diff: chrome/browser/chromeos/display/output_protection_controller_ash.cc

Issue 2675743002: PPAPI: Make output protection API work with mus+ash (Closed)
Patch Set: Addressed review issues Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698