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/dev/ppb_fullscreen_dev.h" | 5 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
| 6 #include "ppapi/c/ppb_fullscreen.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 return enter.functions()->IsFullscreen(instance); |
21 } | 22 } |
22 | 23 |
| 24 PP_Bool IsFullscreen_Dev(PP_Instance instance) { |
| 25 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
| 26 if (enter.failed()) |
| 27 return PP_FALSE; |
| 28 return enter.functions()->IsFullscreen_Dev(instance); |
| 29 } |
| 30 |
23 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { | 31 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { |
24 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); | 32 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
25 if (enter.failed()) | 33 if (enter.failed()) |
26 return PP_FALSE; | 34 return PP_FALSE; |
27 return enter.functions()->SetFullscreen(instance, fullscreen); | 35 return enter.functions()->SetFullscreen(instance, fullscreen); |
28 } | 36 } |
29 | 37 |
| 38 PP_Bool SetFullscreen_Dev(PP_Instance instance, PP_Bool fullscreen) { |
| 39 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
| 40 if (enter.failed()) |
| 41 return PP_FALSE; |
| 42 return enter.functions()->SetFullscreen_Dev(instance, fullscreen); |
| 43 } |
| 44 |
30 PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) { | 45 PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) { |
31 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); | 46 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
32 if (enter.failed()) | 47 if (enter.failed()) |
33 return PP_FALSE; | 48 return PP_FALSE; |
34 return enter.functions()->GetScreenSize(instance, size); | 49 return enter.functions()->GetScreenSize(instance, size); |
35 } | 50 } |
36 | 51 |
37 const PPB_Fullscreen_Dev g_ppb_fullscreen_thunk = { | 52 PP_Bool GetScreenSize_Dev(PP_Instance instance, PP_Size* size) { |
| 53 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
| 54 if (enter.failed()) |
| 55 return PP_FALSE; |
| 56 return enter.functions()->GetScreenSize_Dev(instance, size); |
| 57 } |
| 58 |
| 59 const PPB_Fullscreen g_ppb_fullscreen_thunk = { |
38 &IsFullscreen, | 60 &IsFullscreen, |
39 &SetFullscreen, | 61 &SetFullscreen, |
40 &GetScreenSize | 62 &GetScreenSize |
41 }; | 63 }; |
42 | 64 |
| 65 const PPB_Fullscreen_Dev g_ppb_fullscreen_dev_thunk = { |
| 66 &IsFullscreen_Dev, |
| 67 &SetFullscreen_Dev, |
| 68 &GetScreenSize_Dev |
| 69 }; |
| 70 |
43 } // namespace | 71 } // namespace |
44 | 72 |
45 const PPB_Fullscreen_Dev* GetPPB_Fullscreen_Thunk() { | 73 const PPB_Fullscreen* GetPPB_Fullscreen_Thunk() { |
46 return &g_ppb_fullscreen_thunk; | 74 return &g_ppb_fullscreen_thunk; |
47 } | 75 } |
48 | 76 |
| 77 const PPB_Fullscreen_Dev* GetPPB_Fullscreen_Dev_Thunk() { |
| 78 return &g_ppb_fullscreen_dev_thunk; |
| 79 } |
| 80 |
49 } // namespace thunk | 81 } // namespace thunk |
50 } // namespace ppapi | 82 } // namespace ppapi |
OLD | NEW |