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

Side by Side Diff: chrome/browser/chromeos/display/output_protection_delegate.h

Issue 1139923006: Move PepperOutputProtectionMessageFilter::Delegate to OutputProtectionDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/display/output_protection_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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_CHROMEOS_DISPLAY_OUTPUT_PROTECTION_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_DISPLAY_OUTPUT_PROTECTION_DELEGATE_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "ui/aura/window.h"
10 #include "ui/aura/window_observer.h"
11 #include "ui/display/chromeos/display_configurator.h"
12
13 namespace chromeos {
14
15 // A class to query output protection status and/or enable output protection.
16 // All methods except constructor should be invoked in UI thread.
17 class OutputProtectionDelegate : public aura::WindowObserver {
18 public:
19 typedef base::Callback<void(bool /* success */,
20 uint32_t /* link_mask */,
21 uint32_t /* protection_mask*/)>
22 QueryStatusCallback;
23 typedef base::Callback<void(bool /* success */)> EnableProtectionCallback;
24
25 OutputProtectionDelegate(int render_process_id, int render_frame_id);
26 ~OutputProtectionDelegate() override;
27
28 // aura::WindowObserver overrides.
29 void OnWindowHierarchyChanged(
30 const aura::WindowObserver::HierarchyChangeParams& params) override;
31 void OnWindowDestroying(aura::Window* window) override;
32
33 void QueryStatus(const QueryStatusCallback& callback);
34 void EnableProtection(uint32_t desired_method_mask,
35 const EnableProtectionCallback& callback);
36
37 private:
38 ui::DisplayConfigurator::ContentProtectionClientId GetClientId();
39
40 void QueryStatusComplete(
41 const QueryStatusCallback& callback,
42 const ui::DisplayConfigurator::QueryProtectionResponse& response);
43 void EnableProtectionComplete(const EnableProtectionCallback& callback,
44 bool success);
45
46 // Used to lookup the WebContents associated with the render frame.
47 int render_process_id_;
48 int render_frame_id_;
49
50 // Native window being observed.
51 aura::Window* window_;
52
53 ui::DisplayConfigurator::ContentProtectionClientId client_id_;
54
55 // The display id which the renderer currently uses.
56 int64 display_id_;
57
58 // The last desired method mask. Will enable this mask on new display if
59 // renderer changes display.
60 uint32_t desired_method_mask_;
61
62 base::WeakPtrFactory<OutputProtectionDelegate> weak_ptr_factory_;
63 };
64
65 } // namespace chromeos
66
67 #endif // CHROME_BROWSER_CHROMEOS_DISPLAY_OUTPUT_PROTECTION_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/display/output_protection_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698