pepper_output_protection_message_filter.h revision 4e180b6a0b4720a9b8e9e959a882386f690f08ff
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
11#if defined(OS_CHROMEOS)
12#include "chromeos/display/output_configurator.h"
13#endif
14
15namespace content {
16class BrowserPpapiHost;
17}  // namespace content
18
19namespace ppapi {
20namespace host {
21struct HostMessageContext;
22}  // namespace host
23}  // namespace ppapi
24
25namespace chrome {
26
27class PepperOutputProtectionMessageFilter
28    : public ppapi::host::ResourceMessageFilter {
29 public:
30  PepperOutputProtectionMessageFilter(content::BrowserPpapiHost* host,
31                                      PP_Instance instance);
32
33 private:
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#if defined(OS_CHROMEOS)
44  chromeos::OutputConfigurator::OutputProtectionClientId GetClientId();
45#endif
46  int32_t OnQueryStatus(ppapi::host::HostMessageContext* context);
47  int32_t OnEnableProtection(ppapi::host::HostMessageContext* context,
48                             uint32_t desired_method_mask);
49
50#if defined(OS_CHROMEOS)
51  chromeos::OutputConfigurator::OutputProtectionClientId client_id_;
52
53  // Used to lookup the WebContents associated with this PP_Instance.
54  int render_process_id_;
55  int render_view_id_;
56#endif
57
58  DISALLOW_COPY_AND_ASSIGN(PepperOutputProtectionMessageFilter);
59};
60
61}  // namespace chrome
62
63#endif  // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_OUTPUT_PROTECTION_MESSAGE_FILTER_H_
64