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 "ppapi/proxy/flash_fullscreen_resource.h"
7 #include "ppapi/c/pp_bool.h"
8 #include "ppapi/proxy/ppapi_messages.h"
13 FlashFullscreenResource::FlashFullscreenResource(Connection connection
,
15 : PluginResource(connection
, instance
),
16 is_fullscreen_(PP_FALSE
) {
19 FlashFullscreenResource::~FlashFullscreenResource() {
22 thunk::PPB_Flash_Fullscreen_API
*
23 FlashFullscreenResource::AsPPB_Flash_Fullscreen_API() {
27 PP_Bool
FlashFullscreenResource::IsFullscreen(PP_Instance instance
) {
28 return is_fullscreen_
;
31 PP_Bool
FlashFullscreenResource::SetFullscreen(PP_Instance instance
,
33 if (!sent_create_to_renderer())
34 SendCreate(RENDERER
, PpapiHostMsg_FlashFullscreen_Create());
35 int32_t result
= SyncCall
<IPC::Message
>(RENDERER
,
36 PpapiHostMsg_FlashFullscreen_SetFullscreen(PP_ToBool(fullscreen
)));
37 return PP_FromBool(result
== PP_OK
);
40 void FlashFullscreenResource::SetLocalIsFullscreen(PP_Instance instance
,
41 PP_Bool is_fullscreen
) {
42 is_fullscreen_
= is_fullscreen
;