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

Unified Diff: chrome/browser/chromeos/display/output_protection_delegate.h

Issue 2675743002: PPAPI: Make output protection API work with mus+ash (Closed)
Patch Set: Fix try bot 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_delegate.h
diff --git a/chrome/browser/chromeos/display/output_protection_delegate.h b/chrome/browser/chromeos/display/output_protection_delegate.h
index 2300c8fa538a57b8937b5b6fcf7c9314a875fc60..07fffcf0cdc31b6b0559c23c08a3b8e286c0e4cb 100644
--- a/chrome/browser/chromeos/display/output_protection_delegate.h
+++ b/chrome/browser/chromeos/display/output_protection_delegate.h
@@ -7,10 +7,12 @@
#include <stdint.h>
+#include <memory>
+
+#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
-#include "ui/display/manager/chromeos/display_configurator.h"
namespace chromeos {
@@ -36,12 +38,28 @@ class OutputProtectionDelegate : public aura::WindowObserver {
void EnableProtection(uint32_t desired_method_mask,
const EnableProtectionCallback& callback);
- private:
- display::DisplayConfigurator::ContentProtectionClientId GetClientId();
+ // Display content protection controller interface.
+ class Controller {
+ public:
+ Controller();
+ virtual ~Controller();
+ virtual bool Init() = 0;
+ virtual void QueryStatus(int64_t display_id,
+ const QueryStatusCallback& callback) = 0;
+ virtual void EnableProtection(int64_t display_id,
+ uint32_t desired_method_mask,
+ const EnableProtectionCallback& callback) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Controller);
+ };
- void QueryStatusComplete(
- const QueryStatusCallback& callback,
- const display::DisplayConfigurator::QueryProtectionResponse& response);
+ private:
+ bool InitializeControllerIfNecessary();
+ void QueryStatusComplete(const QueryStatusCallback& callback,
+ bool success,
+ uint32_t link_mask,
+ uint32_t protection_mask);
void EnableProtectionComplete(const EnableProtectionCallback& callback,
bool success);
@@ -52,8 +70,6 @@ class OutputProtectionDelegate : public aura::WindowObserver {
// Native window being observed.
aura::Window* window_;
- display::DisplayConfigurator::ContentProtectionClientId client_id_;
-
// The display id which the renderer currently uses.
int64_t display_id_;
@@ -61,7 +77,12 @@ class OutputProtectionDelegate : public aura::WindowObserver {
// renderer changes display.
uint32_t desired_method_mask_;
+ // The display content protection controller.
+ std::unique_ptr<Controller> controller_;
+
base::WeakPtrFactory<OutputProtectionDelegate> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(OutputProtectionDelegate);
};
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698