1 // Copyright (c) 2012 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 #include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h"
7 #include "content/public/renderer/pepper_plugin_instance.h"
8 #include "content/public/renderer/renderer_ppapi_host.h"
9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/host/dispatch_host_message.h"
11 #include "ppapi/host/host_message_context.h"
12 #include "ppapi/host/ppapi_host.h"
13 #include "ppapi/proxy/ppapi_messages.h"
17 PepperFlashFullscreenHost::PepperFlashFullscreenHost(
18 content::RendererPpapiHost
* host
,
21 : ResourceHost(host
->GetPpapiHost(), instance
, resource
),
22 renderer_ppapi_host_(host
) {
25 PepperFlashFullscreenHost::~PepperFlashFullscreenHost() {
28 int32_t PepperFlashFullscreenHost::OnResourceMessageReceived(
29 const IPC::Message
& msg
,
30 ppapi::host::HostMessageContext
* context
) {
31 IPC_BEGIN_MESSAGE_MAP(PepperFlashFullscreenHost
, msg
)
32 PPAPI_DISPATCH_HOST_RESOURCE_CALL(
33 PpapiHostMsg_FlashFullscreen_SetFullscreen
,
36 return PP_ERROR_FAILED
;
39 int32_t PepperFlashFullscreenHost::OnSetFullscreen(
40 ppapi::host::HostMessageContext
* context
,
42 content::PepperPluginInstance
* plugin_instance
=
43 renderer_ppapi_host_
->GetPluginInstance(pp_instance());
44 if (plugin_instance
) {
45 plugin_instance
->FlashSetFullscreen(fullscreen
, true);
48 return PP_ERROR_FAILED
;