pepper_flash_drm_host.h revision 4e180b6a0b4720a9b8e9e959a882386f690f08ff
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. 4 5#ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ 6#define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ 7 8#include <string> 9 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" 14 15namespace content { 16class BrowserPpapiHost; 17} 18 19namespace IPC { 20class Message; 21} 22 23namespace chrome { 24class MonitorFinder; 25 26class PepperFlashDRMHost : public ppapi::host::ResourceHost { 27 public: 28 PepperFlashDRMHost(content::BrowserPpapiHost* host, 29 PP_Instance instance, 30 PP_Resource resource); 31 virtual ~PepperFlashDRMHost(); 32 33 // ResourceHost override. 34 virtual int32_t OnResourceMessageReceived( 35 const IPC::Message& msg, 36 ppapi::host::HostMessageContext* context) OVERRIDE; 37 38 private: 39 // IPC message handler. 40 int32_t OnHostMsgGetDeviceID(ppapi::host::HostMessageContext* context); 41 int32_t OnHostMsgGetHmonitor(ppapi::host::HostMessageContext* context); 42 43 // Called by the fetcher when the device ID was retrieved, or the empty string 44 // on error. 45 void GotDeviceID(ppapi::host::ReplyMessageContext reply_context, 46 const std::string& id, 47 int32_t result); 48 49 scoped_refptr<DeviceIDFetcher> fetcher_; 50 scoped_refptr<MonitorFinder> monitor_finder_; 51 52 base::WeakPtrFactory<PepperFlashDRMHost> weak_factory_; 53 54 DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMHost); 55}; 56 57} // namespace chrome 58 59#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ 60