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

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

Issue 2675743002: PPAPI: Make output protection API work with mus+ash (Closed)
Patch Set: Update 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..bbeb7ee911bb616a7e0e0fc801afa4c9558d4b08 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,14 +38,23 @@ 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 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);
- void EnableProtectionComplete(const EnableProtectionCallback& callback,
- bool success);
+ private:
+ 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