Chromium Code Reviews| 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/proxy/ppp_instance_proxy.h" | 5 #include "ppapi/proxy/ppp_instance_proxy.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 9 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
| 10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| 11 #include "ppapi/c/ppb_core.h" | 11 #include "ppapi/c/ppb_core.h" |
| 12 #include "ppapi/c/ppb_fullscreen.h" | |
| 12 #include "ppapi/c/ppp_instance.h" | 13 #include "ppapi/c/ppp_instance.h" |
| 13 #include "ppapi/proxy/host_dispatcher.h" | 14 #include "ppapi/proxy/host_dispatcher.h" |
| 14 #include "ppapi/proxy/plugin_dispatcher.h" | 15 #include "ppapi/proxy/plugin_dispatcher.h" |
| 15 #include "ppapi/proxy/plugin_resource_tracker.h" | 16 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 16 #include "ppapi/proxy/ppapi_messages.h" | 17 #include "ppapi/proxy/ppapi_messages.h" |
| 17 #include "ppapi/proxy/ppb_url_loader_proxy.h" | 18 #include "ppapi/proxy/ppb_url_loader_proxy.h" |
| 18 | 19 |
| 19 namespace ppapi { | 20 namespace ppapi { |
| 20 namespace proxy { | 21 namespace proxy { |
| 21 | 22 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 41 | 42 |
| 42 void DidDestroy(PP_Instance instance) { | 43 void DidDestroy(PP_Instance instance) { |
| 43 HostDispatcher::GetForInstance(instance)->Send( | 44 HostDispatcher::GetForInstance(instance)->Send( |
| 44 new PpapiMsg_PPPInstance_DidDestroy(INTERFACE_ID_PPP_INSTANCE, instance)); | 45 new PpapiMsg_PPPInstance_DidDestroy(INTERFACE_ID_PPP_INSTANCE, instance)); |
| 45 } | 46 } |
| 46 | 47 |
| 47 void DidChangeView(PP_Instance instance, | 48 void DidChangeView(PP_Instance instance, |
| 48 const PP_Rect* position, | 49 const PP_Rect* position, |
| 49 const PP_Rect* clip) { | 50 const PP_Rect* clip) { |
| 50 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); | 51 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| 51 const PPB_Fullscreen_Dev* fullscreen_interface = | 52 const PPB_Fullscreen* fullscreen_interface = |
| 53 static_cast<const PPB_Fullscreen*>( | |
| 54 dispatcher->GetLocalInterface(PPB_FULLSCREEN_INTERFACE)); | |
| 55 DCHECK(fullscreen_interface); | |
| 56 const PPB_Fullscreen_Dev* fullscreen_dev_interface = | |
| 52 static_cast<const PPB_Fullscreen_Dev*>( | 57 static_cast<const PPB_Fullscreen_Dev*>( |
| 53 dispatcher->GetLocalInterface(PPB_FULLSCREEN_DEV_INTERFACE)); | 58 dispatcher->GetLocalInterface(PPB_FULLSCREEN_DEV_INTERFACE)); |
| 54 DCHECK(fullscreen_interface); | 59 DCHECK(fullscreen_dev_interface); |
| 55 PP_Bool fullscreen = fullscreen_interface->IsFullscreen(instance); | 60 PP_Bool fullscreen = fullscreen_interface->IsFullscreen(instance); |
| 61 PP_Bool fullscreen_dev = fullscreen_dev_interface->IsFullscreen(instance); | |
| 62 PP_Bool fullscreen_either = ((fullscreen == PP_TRUE || | |
|
piman
2011/09/09 01:33:44
You need to send both flags separately if you want
polina
2011/09/26 21:57:00
Done.
| |
| 63 fullscreen_dev == PP_TRUE) ? | |
| 64 PP_TRUE : PP_FALSE); | |
| 56 dispatcher->Send( | 65 dispatcher->Send( |
| 57 new PpapiMsg_PPPInstance_DidChangeView(INTERFACE_ID_PPP_INSTANCE, | 66 new PpapiMsg_PPPInstance_DidChangeView(INTERFACE_ID_PPP_INSTANCE, |
| 58 instance, *position, *clip, | 67 instance, *position, *clip, |
| 59 fullscreen)); | 68 fullscreen_either)); |
| 60 } | 69 } |
| 61 | 70 |
| 62 void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) { | 71 void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) { |
| 63 HostDispatcher::GetForInstance(instance)->Send( | 72 HostDispatcher::GetForInstance(instance)->Send( |
| 64 new PpapiMsg_PPPInstance_DidChangeFocus(INTERFACE_ID_PPP_INSTANCE, | 73 new PpapiMsg_PPPInstance_DidChangeFocus(INTERFACE_ID_PPP_INSTANCE, |
| 65 instance, has_focus)); | 74 instance, has_focus)); |
| 66 } | 75 } |
| 67 | 76 |
| 68 PP_Bool HandleDocumentLoad(PP_Instance instance, | 77 PP_Bool HandleDocumentLoad(PP_Instance instance, |
| 69 PP_Resource url_loader) { | 78 PP_Resource url_loader) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 // with. The plugin will normally take an additional reference which will keep | 228 // with. The plugin will normally take an additional reference which will keep |
| 220 // the resource alive in the plugin (and the one reference in the renderer | 229 // the resource alive in the plugin (and the one reference in the renderer |
| 221 // representing all plugin references). | 230 // representing all plugin references). |
| 222 // Once all references at the plugin side are released, the renderer side will | 231 // Once all references at the plugin side are released, the renderer side will |
| 223 // be notified and release the reference added in HandleDocumentLoad() above. | 232 // be notified and release the reference added in HandleDocumentLoad() above. |
| 224 PluginResourceTracker::GetInstance()->ReleaseResource(plugin_loader); | 233 PluginResourceTracker::GetInstance()->ReleaseResource(plugin_loader); |
| 225 } | 234 } |
| 226 | 235 |
| 227 } // namespace proxy | 236 } // namespace proxy |
| 228 } // namespace ppapi | 237 } // namespace ppapi |
| OLD | NEW |