1 // Copyright (c) 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.
5 #ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_
6 #define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_
10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
12 #include "ppapi/host/host_message_context.h"
13 #include "ppapi/host/resource_host.h"
16 class BrowserPpapiHost
;
26 class PepperFlashDRMHost
: public ppapi::host::ResourceHost
{
28 PepperFlashDRMHost(content::BrowserPpapiHost
* host
,
30 PP_Resource resource
);
31 ~PepperFlashDRMHost() override
;
33 // ResourceHost override.
34 int32_t OnResourceMessageReceived(
35 const IPC::Message
& msg
,
36 ppapi::host::HostMessageContext
* context
) override
;
39 // IPC message handler.
40 int32_t OnHostMsgGetDeviceID(ppapi::host::HostMessageContext
* context
);
41 int32_t OnHostMsgGetHmonitor(ppapi::host::HostMessageContext
* context
);
42 int32_t OnHostMsgMonitorIsExternal(ppapi::host::HostMessageContext
* context
);
44 // Called by the fetcher when the device ID was retrieved, or the empty string
46 void GotDeviceID(ppapi::host::ReplyMessageContext reply_context
,
47 const std::string
& id
,
50 scoped_refptr
<DeviceIDFetcher
> fetcher_
;
51 scoped_refptr
<MonitorFinder
> monitor_finder_
;
53 base::WeakPtrFactory
<PepperFlashDRMHost
> weak_factory_
;
55 DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMHost
);
60 #endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_