OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_IMPL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_IMPL_H_ |
6 #define CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_IMPL_H_ | 6 #define CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_IMPL_H_ |
7 | 7 |
8 #include "content/public/browser/render_frame_host.h" | 8 #include "content/public/browser/render_frame_host.h" |
9 #include "media/mojo/interfaces/output_protection.mojom.h" | 9 #include "media/mojo/interfaces/output_protection.mojom.h" |
10 #include "mojo/public/cpp/bindings/strong_binding.h" | |
11 | 10 |
12 // Implements media::mojom::OutputProtection to check display links and | 11 // Implements media::mojom::OutputProtection to check display links and |
13 // their statuses. On all platforms we'll check the network links. On ChromeOS | 12 // their statuses. On all platforms we'll check the network links. On ChromeOS |
14 // we'll also check the hardware links. Can only be used on the UI thread. | 13 // we'll also check the hardware links. Can only be used on the UI thread. |
15 class OutputProtectionImpl : public media::mojom::OutputProtection { | 14 class OutputProtectionImpl : public media::mojom::OutputProtection { |
16 public: | 15 public: |
17 static void Create( | 16 static void Create( |
18 content::RenderFrameHost* render_frame_host, | 17 content::RenderFrameHost* render_frame_host, |
19 mojo::InterfaceRequest<media::mojom::OutputProtection> request); | 18 mojo::InterfaceRequest<media::mojom::OutputProtection> request); |
20 | 19 |
21 OutputProtectionImpl(content::RenderFrameHost* render_frame_host, | 20 explicit OutputProtectionImpl(content::RenderFrameHost* render_frame_host); |
22 mojo::InterfaceRequest<OutputProtection> request); | |
23 ~OutputProtectionImpl() final; | 21 ~OutputProtectionImpl() final; |
24 | 22 |
25 // media::mojom::OutputProtection implementation. | 23 // media::mojom::OutputProtection implementation. |
26 void QueryStatus(const QueryStatusCallback& callback) final; | 24 void QueryStatus(const QueryStatusCallback& callback) final; |
27 void EnableProtection(uint32_t desired_protection_mask, | 25 void EnableProtection(uint32_t desired_protection_mask, |
28 const EnableProtectionCallback& callback) final; | 26 const EnableProtectionCallback& callback) final; |
29 | 27 |
30 private: | 28 private: |
31 mojo::StrongBinding<media::mojom::OutputProtection> binding_; | |
32 | |
33 content::RenderFrameHost* const render_frame_host_; | 29 content::RenderFrameHost* const render_frame_host_; |
34 | 30 |
35 base::WeakPtrFactory<OutputProtectionImpl> weak_factory_; | 31 base::WeakPtrFactory<OutputProtectionImpl> weak_factory_; |
36 }; | 32 }; |
37 | 33 |
38 #endif // CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_IMPL_H_ | 34 #endif // CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_IMPL_H_ |
OLD | NEW |