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

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

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_delegate.h
diff --git a/chrome/browser/chromeos/display/output_protection_delegate.h b/chrome/browser/chromeos/display/output_protection_delegate.h
index 2300c8fa538a57b8937b5b6fcf7c9314a875fc60..2ff55a4594685c5a01d74aaa069cdbe5dd9a61ba 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 {
@@ -22,7 +24,7 @@ class OutputProtectionDelegate : public aura::WindowObserver {
uint32_t /* link_mask */,
uint32_t /* protection_mask*/)>
QueryStatusCallback;
- typedef base::Callback<void(bool /* success */)> EnableProtectionCallback;
+ typedef base::Callback<void(bool /* success */)> SetProtectionCallback;
OutputProtectionDelegate(int render_process_id, int render_frame_id);
~OutputProtectionDelegate() override;
@@ -33,17 +35,26 @@ class OutputProtectionDelegate : public aura::WindowObserver {
void OnWindowDestroying(aura::Window* window) override;
void QueryStatus(const QueryStatusCallback& callback);
- void EnableProtection(uint32_t desired_method_mask,
- const EnableProtectionCallback& callback);
+ void SetProtection(uint32_t desired_method_mask,
+ const SetProtectionCallback& callback);
+
+ // Display content protection controller interface.
+ class Controller {
+ public:
+ Controller();
+ virtual ~Controller();
+ virtual void QueryStatus(int64_t display_id,
+ const QueryStatusCallback& callback) = 0;
+ virtual void SetProtection(int64_t display_id,
+ uint32_t desired_method_mask,
+ const SetProtectionCallback& callback) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Controller);
+ };
private:
- display::DisplayConfigurator::ContentProtectionClientId GetClientId();
-
- void QueryStatusComplete(
- const QueryStatusCallback& callback,
- const display::DisplayConfigurator::QueryProtectionResponse& response);
- void EnableProtectionComplete(const EnableProtectionCallback& callback,
- bool success);
+ bool InitializeControllerIfNecessary();
// Used to lookup the WebContents associated with the render frame.
int render_process_id_;
@@ -52,8 +63,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 +70,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