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

Side by Side Diff: chrome/browser/media/output_protection_proxy.h

Issue 2085063002: media: Add OutputProtectionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix windows compile error Created 4 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_PROXY_H_
6 #define CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_PROXY_H_
7
8 #include <stdint.h>
9
10 #include "base/memory/weak_ptr.h"
11
12 #if defined(OS_CHROMEOS)
13 #include "chrome/browser/chromeos/display/output_protection_delegate.h"
14 #endif
15
16 namespace chrome {
17
18 // A class to query output protection status and/or enable output protection.
19 //
20 // On ChromeOS, operations on the physical displays are delegated to
ddorwin 2016/06/23 19:24:28 nit: space before OS.
xhwang 2016/06/23 20:53:49 Done.
21 // OutputProtectionDelegate. On other platforms, physical displays are not
22 // checked.
23 //
24 // On all platforms, in QueryStatusComplete(), this class checks the network
25 // links and adds it to the existing link mask.
26 //
27 // All methods except constructor should be invoked in UI thread.
28 class OutputProtectionProxy {
29 public:
30 typedef base::Callback<void(bool /* success */,
31 uint32_t /* link_mask */,
32 uint32_t /* protection_mask*/)>
33 QueryStatusCallback;
34 typedef base::Callback<void(bool /* success */)> EnableProtectionCallback;
35
36 OutputProtectionProxy(int render_process_id, int render_frame_id);
37 ~OutputProtectionProxy();
38
39 void QueryStatus(const QueryStatusCallback& callback);
40 void EnableProtection(uint32_t desired_method_mask,
41 const EnableProtectionCallback& callback);
42
43 private:
44 // Callbacks for QueryStatus() and EnableProtection().
45 void QueryStatusComplete(const QueryStatusCallback& callback,
ddorwin 2016/06/23 19:24:28 On... ? Or something like ProcessQueryStatusResult
xhwang 2016/06/23 20:53:49 Done.
46 bool success,
47 uint32_t link_mask,
48 uint32_t protection_mask);
49
50 // Used to lookup the WebContents associated with the render frame.
51 int render_process_id_;
52 int render_frame_id_;
53
54 #if defined(OS_CHROMEOS)
55 chromeos::OutputProtectionDelegate output_protection_delegate_;
56 #endif
57
58 base::WeakPtrFactory<OutputProtectionProxy> weak_ptr_factory_;
59 };
60
61 } // namespace chrome
62
63 #endif // CHROME_BROWSER_MEDIA_OUTPUT_PROTECTION_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698