OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/proxy/ppb_fullscreen_proxy.h" | 5 #include "ppapi/proxy/ppb_fullscreen_proxy.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
8 #include "ppapi/proxy/plugin_dispatcher.h" | 8 #include "ppapi/proxy/plugin_dispatcher.h" |
9 #include "ppapi/proxy/ppapi_messages.h" | 9 #include "ppapi/proxy/ppapi_messages.h" |
10 | 10 |
11 namespace pp { | 11 namespace pp { |
12 namespace proxy { | 12 namespace proxy { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 PP_Bool IsFullscreen(PP_Instance instance) { | 16 PP_Bool IsFullscreen(PP_Instance instance) { |
| 17 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
| 18 if (!dispatcher) |
| 19 return PP_FALSE; |
| 20 |
17 PP_Bool result = PP_FALSE; | 21 PP_Bool result = PP_FALSE; |
18 PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBFullscreen_IsFullscreen( | 22 dispatcher->Send(new PpapiHostMsg_PPBFullscreen_IsFullscreen( |
19 INTERFACE_ID_PPB_FULLSCREEN, instance, &result)); | 23 INTERFACE_ID_PPB_FULLSCREEN, instance, &result)); |
20 return result; | 24 return result; |
21 } | 25 } |
22 | 26 |
23 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { | 27 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { |
| 28 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
| 29 if (!dispatcher) |
| 30 return PP_FALSE; |
| 31 |
24 PP_Bool result = PP_FALSE; | 32 PP_Bool result = PP_FALSE; |
25 PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBFullscreen_SetFullscreen( | 33 dispatcher->Send(new PpapiHostMsg_PPBFullscreen_SetFullscreen( |
26 INTERFACE_ID_PPB_FULLSCREEN, instance, fullscreen, &result)); | 34 INTERFACE_ID_PPB_FULLSCREEN, instance, fullscreen, &result)); |
27 return result; | 35 return result; |
28 } | 36 } |
29 | 37 |
30 const PPB_Fullscreen_Dev ppb_fullscreen = { | 38 const PPB_Fullscreen_Dev ppb_fullscreen = { |
31 &IsFullscreen, | 39 &IsFullscreen, |
32 &SetFullscreen | 40 &SetFullscreen |
33 }; | 41 }; |
34 | 42 |
35 } // namespace | 43 } // namespace |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 77 } |
70 | 78 |
71 void PPB_Fullscreen_Proxy::OnMsgSetFullscreen(PP_Instance instance, | 79 void PPB_Fullscreen_Proxy::OnMsgSetFullscreen(PP_Instance instance, |
72 PP_Bool fullscreen, | 80 PP_Bool fullscreen, |
73 PP_Bool* result) { | 81 PP_Bool* result) { |
74 *result = ppb_fullscreen_target()->SetFullscreen(instance, fullscreen); | 82 *result = ppb_fullscreen_target()->SetFullscreen(instance, fullscreen); |
75 } | 83 } |
76 | 84 |
77 } // namespace proxy | 85 } // namespace proxy |
78 } // namespace pp | 86 } // namespace pp |
OLD | NEW |