| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/c/ppb_fullscreen.h" | 5 #include "ppapi/c/ppb_fullscreen.h" |
| 6 #include "ppapi/shared_impl/ppb_view_shared.h" |
| 6 #include "ppapi/thunk/thunk.h" | 7 #include "ppapi/thunk/thunk.h" |
| 7 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
| 8 #include "ppapi/thunk/ppb_instance_api.h" | 9 #include "ppapi/thunk/ppb_instance_api.h" |
| 9 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
| 10 | 11 |
| 11 namespace ppapi { | 12 namespace ppapi { |
| 12 namespace thunk { | 13 namespace thunk { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 PP_Bool IsFullscreen(PP_Instance instance) { | 17 PP_Bool IsFullscreen(PP_Instance instance) { |
| 17 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); | 18 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
| 18 if (enter.failed()) | 19 if (enter.failed()) |
| 19 return PP_FALSE; | 20 return PP_FALSE; |
| 20 return enter.functions()->IsFullscreen(instance); | 21 const ViewData* view = enter.functions()->GetViewData(instance); |
| 22 if (!view) |
| 23 return PP_FALSE; |
| 24 return PP_FromBool(view->is_fullscreen); |
| 21 } | 25 } |
| 22 | 26 |
| 23 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { | 27 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { |
| 24 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); | 28 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
| 25 if (enter.failed()) | 29 if (enter.failed()) |
| 26 return PP_FALSE; | 30 return PP_FALSE; |
| 27 return enter.functions()->SetFullscreen(instance, fullscreen); | 31 return enter.functions()->SetFullscreen(instance, fullscreen); |
| 28 } | 32 } |
| 29 | 33 |
| 30 PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) { | 34 PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 41 }; | 45 }; |
| 42 | 46 |
| 43 } // namespace | 47 } // namespace |
| 44 | 48 |
| 45 const PPB_Fullscreen* GetPPB_Fullscreen_Thunk() { | 49 const PPB_Fullscreen* GetPPB_Fullscreen_Thunk() { |
| 46 return &g_ppb_fullscreen_thunk; | 50 return &g_ppb_fullscreen_thunk; |
| 47 } | 51 } |
| 48 | 52 |
| 49 } // namespace thunk | 53 } // namespace thunk |
| 50 } // namespace ppapi | 54 } // namespace ppapi |
| OLD | NEW |