Home | History | Annotate | Download | only in proxy
      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.
      4 
      5 #include "ppapi/proxy/flash_fullscreen_resource.h"
      6 
      7 #include "ppapi/c/pp_bool.h"
      8 #include "ppapi/proxy/ppapi_messages.h"
      9 
     10 namespace ppapi {
     11 namespace proxy {
     12 
     13 FlashFullscreenResource::FlashFullscreenResource(Connection connection,
     14                                                  PP_Instance instance)
     15     : PluginResource(connection, instance),
     16       is_fullscreen_(PP_FALSE) {
     17 }
     18 
     19 FlashFullscreenResource::~FlashFullscreenResource() {
     20 }
     21 
     22 thunk::PPB_Flash_Fullscreen_API*
     23 FlashFullscreenResource::AsPPB_Flash_Fullscreen_API() {
     24   return this;
     25 }
     26 
     27 PP_Bool FlashFullscreenResource::IsFullscreen(PP_Instance instance) {
     28   return is_fullscreen_;
     29 }
     30 
     31 PP_Bool FlashFullscreenResource::SetFullscreen(PP_Instance instance,
     32                                                PP_Bool fullscreen) {
     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);
     38 }
     39 
     40 void FlashFullscreenResource::SetLocalIsFullscreen(PP_Instance instance,
     41                                                    PP_Bool is_fullscreen) {
     42   is_fullscreen_ = is_fullscreen;
     43 }
     44 
     45 }  // namespace proxy
     46 }  // namespace ppapi
     47