OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h" | 5 #include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h" |
6 | 6 |
7 #include "content/public/renderer/pepper_plugin_instance.h" | 7 #include "content/public/renderer/pepper_plugin_instance.h" |
8 #include "content/public/renderer/renderer_ppapi_host.h" | 8 #include "content/public/renderer/renderer_ppapi_host.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/host/dispatch_host_message.h" | 10 #include "ppapi/host/dispatch_host_message.h" |
11 #include "ppapi/host/host_message_context.h" | 11 #include "ppapi/host/host_message_context.h" |
12 #include "ppapi/host/ppapi_host.h" | 12 #include "ppapi/host/ppapi_host.h" |
13 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
14 | 14 |
15 PepperFlashFullscreenHost::PepperFlashFullscreenHost( | 15 PepperFlashFullscreenHost::PepperFlashFullscreenHost( |
16 content::RendererPpapiHost* host, | 16 content::RendererPpapiHost* host, |
17 PP_Instance instance, | 17 PP_Instance instance, |
18 PP_Resource resource) | 18 PP_Resource resource) |
19 : ResourceHost(host->GetPpapiHost(), instance, resource), | 19 : ResourceHost(host->GetPpapiHost(), instance, resource), |
20 renderer_ppapi_host_(host) {} | 20 renderer_ppapi_host_(host) {} |
21 | 21 |
22 PepperFlashFullscreenHost::~PepperFlashFullscreenHost() {} | 22 PepperFlashFullscreenHost::~PepperFlashFullscreenHost() {} |
23 | 23 |
24 int32_t PepperFlashFullscreenHost::OnResourceMessageReceived( | 24 int32_t PepperFlashFullscreenHost::OnResourceMessageReceived( |
25 const IPC::Message& msg, | 25 const IPC::Message& msg, |
26 ppapi::host::HostMessageContext* context) { | 26 ppapi::host::HostMessageContext* context) { |
27 IPC_BEGIN_MESSAGE_MAP(PepperFlashFullscreenHost, msg) | 27 PPAPI_BEGIN_MESSAGE_MAP(PepperFlashFullscreenHost, msg) |
28 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_FlashFullscreen_SetFullscreen, | 28 PPAPI_DISPATCH_HOST_RESOURCE_CALL( |
29 OnSetFullscreen) | 29 PpapiHostMsg_FlashFullscreen_SetFullscreen, |
30 IPC_END_MESSAGE_MAP() | 30 OnSetFullscreen) |
| 31 PPAPI_END_MESSAGE_MAP() |
31 return PP_ERROR_FAILED; | 32 return PP_ERROR_FAILED; |
32 } | 33 } |
33 | 34 |
34 int32_t PepperFlashFullscreenHost::OnSetFullscreen( | 35 int32_t PepperFlashFullscreenHost::OnSetFullscreen( |
35 ppapi::host::HostMessageContext* context, | 36 ppapi::host::HostMessageContext* context, |
36 bool fullscreen) { | 37 bool fullscreen) { |
37 content::PepperPluginInstance* plugin_instance = | 38 content::PepperPluginInstance* plugin_instance = |
38 renderer_ppapi_host_->GetPluginInstance(pp_instance()); | 39 renderer_ppapi_host_->GetPluginInstance(pp_instance()); |
39 if (plugin_instance && plugin_instance->FlashSetFullscreen(fullscreen, true)) | 40 if (plugin_instance && plugin_instance->FlashSetFullscreen(fullscreen, true)) |
40 return PP_OK; | 41 return PP_OK; |
41 return PP_ERROR_FAILED; | 42 return PP_ERROR_FAILED; |
42 } | 43 } |
OLD | NEW |