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_RENDERER_HOST_PEPPER_PEPPER_OUTPUT_PROTECTION_MESSAGE_FILTER_H_
6#define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_OUTPUT_PROTECTION_MESSAGE_FILTER_H_
7
8#include "ppapi/c/pp_instance.h"
9#include "ppapi/host/resource_message_filter.h"
10
11namespace content {
12class BrowserPpapiHost;
13}  // namespace content
14
15namespace ppapi {
16namespace host {
17struct HostMessageContext;
18}  // namespace host
19}  // namespace ppapi
20
21namespace chrome {
22
23class PepperOutputProtectionMessageFilter
24    : public ppapi::host::ResourceMessageFilter {
25 public:
26  PepperOutputProtectionMessageFilter(content::BrowserPpapiHost* host,
27                                      PP_Instance instance);
28
29 private:
30#if defined(OS_CHROMEOS)
31  class Delegate;
32#endif
33
34  // ppapi::host::ResourceMessageFilter overrides.
35  virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
36      const IPC::Message& msg) OVERRIDE;
37  virtual int32_t OnResourceMessageReceived(
38      const IPC::Message& msg,
39      ppapi::host::HostMessageContext* context) OVERRIDE;
40
41  virtual ~PepperOutputProtectionMessageFilter();
42
43  int32_t OnQueryStatus(ppapi::host::HostMessageContext* context);
44  int32_t OnEnableProtection(ppapi::host::HostMessageContext* context,
45                             uint32_t desired_method_mask);
46
47#if defined(OS_CHROMEOS)
48  // Delegator. Should be deleted in UI thread.
49  Delegate* delegate_;
50#endif
51
52  DISALLOW_COPY_AND_ASSIGN(PepperOutputProtectionMessageFilter);
53};
54
55}  // namespace chrome
56
57#endif  // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_OUTPUT_PROTECTION_MESSAGE_FILTER_H_
58