Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" | 5 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" |
| 6 | 6 |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "content/common/browser_plugin_messages.h" | 8 #include "content/common/old_browser_plugin_messages.h" |
|
jam
2012/07/30 15:27:44
ditto
Fady Samuel
2012/07/30 22:11:50
Done.
| |
| 9 #include "content/common/child_process.h" | 9 #include "content/common/child_process.h" |
| 10 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" | 10 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" |
| 11 #include "content/renderer/browser_plugin/old/browser_plugin_var_serialization_r ules.h" | 11 #include "content/renderer/browser_plugin/old/browser_plugin_var_serialization_r ules.h" |
| 12 #include "content/renderer/render_thread_impl.h" | 12 #include "content/renderer/render_thread_impl.h" |
| 13 #include "content/renderer/render_view_impl.h" | 13 #include "content/renderer/render_view_impl.h" |
| 14 #include "ppapi/c/pp_bool.h" | 14 #include "ppapi/c/pp_bool.h" |
| 15 #include "ppapi/c/pp_graphics_3d.h" | 15 #include "ppapi/c/pp_graphics_3d.h" |
| 16 #include "ppapi/proxy/ppapi_command_buffer_proxy.h" | 16 #include "ppapi/proxy/ppapi_command_buffer_proxy.h" |
| 17 #include "ppapi/proxy/ppapi_messages.h" | 17 #include "ppapi/proxy/ppapi_messages.h" |
| 18 #include "ppapi/shared_impl/api_id.h" | 18 #include "ppapi/shared_impl/api_id.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 49 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeView, | 49 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeView, |
| 50 OnDidChangeView) | 50 OnDidChangeView) |
| 51 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeFocus, | 51 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeFocus, |
| 52 OnDidChangeFocus) | 52 OnDidChangeFocus) |
| 53 IPC_MESSAGE_HANDLER(PpapiMsg_PPPMessaging_HandleMessage, | 53 IPC_MESSAGE_HANDLER(PpapiMsg_PPPMessaging_HandleMessage, |
| 54 OnHandleMessage) | 54 OnHandleMessage) |
| 55 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInputEvent_HandleFilteredInputEvent, | 55 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInputEvent_HandleFilteredInputEvent, |
| 56 OnHandleFilteredInputEvent) | 56 OnHandleFilteredInputEvent) |
| 57 IPC_MESSAGE_HANDLER(PpapiMsg_PPPGraphics3D_ContextLost, | 57 IPC_MESSAGE_HANDLER(PpapiMsg_PPPGraphics3D_ContextLost, |
| 58 OnContextLost) | 58 OnContextLost) |
| 59 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestReady, | 59 IPC_MESSAGE_HANDLER(OldBrowserPluginMsg_GuestReady, |
| 60 OnGuestReady) | 60 OnGuestReady) |
| 61 // Have the super handle all other messages. | 61 // Have the super handle all other messages. |
| 62 IPC_MESSAGE_UNHANDLED(handled = false) | 62 IPC_MESSAGE_UNHANDLED(handled = false) |
| 63 IPC_END_MESSAGE_MAP() | 63 IPC_END_MESSAGE_MAP() |
| 64 | 64 |
| 65 return handled; | 65 return handled; |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool GuestToEmbedderChannel::Send(IPC::Message* message) { | 68 bool GuestToEmbedderChannel::Send(IPC::Message* message) { |
| 69 // We always want guest->host messages to arrive in-order. If some sync | 69 // We always want guest->host messages to arrive in-order. If some sync |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 void GuestToEmbedderChannel::OnDidChangeView( | 240 void GuestToEmbedderChannel::OnDidChangeView( |
| 241 PP_Instance instance, | 241 PP_Instance instance, |
| 242 const ppapi::ViewData& new_data, | 242 const ppapi::ViewData& new_data, |
| 243 PP_Bool flash_fullscreen) { | 243 PP_Bool flash_fullscreen) { |
| 244 // We can't do anything with this message if we don't have a render view | 244 // We can't do anything with this message if we don't have a render view |
| 245 // yet. If we do have a RenderView then we need to tell the associated | 245 // yet. If we do have a RenderView then we need to tell the associated |
| 246 // WebContentsObserver to resize. | 246 // WebContentsObserver to resize. |
| 247 if (render_view_instances_.find(instance) != render_view_instances_.end()) { | 247 if (render_view_instances_.find(instance) != render_view_instances_.end()) { |
| 248 RenderViewImpl* render_view = render_view_instances_[instance]; | 248 RenderViewImpl* render_view = render_view_instances_[instance]; |
| 249 render_view->Send( | 249 render_view->Send( |
| 250 new BrowserPluginHostMsg_ResizeGuest( | 250 new OldBrowserPluginHostMsg_ResizeGuest( |
| 251 render_view->GetRoutingID(), | 251 render_view->GetRoutingID(), |
| 252 new_data.rect.size.width, | 252 new_data.rect.size.width, |
| 253 new_data.rect.size.height)); | 253 new_data.rect.size.height)); |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 void GuestToEmbedderChannel::OnDidChangeFocus(PP_Instance instance, | 257 void GuestToEmbedderChannel::OnDidChangeFocus(PP_Instance instance, |
| 258 PP_Bool has_focus) { | 258 PP_Bool has_focus) { |
| 259 InstanceMap::iterator it = render_view_instances_.find(instance); | 259 InstanceMap::iterator it = render_view_instances_.find(instance); |
| 260 if (it == render_view_instances_.end()) | 260 if (it == render_view_instances_.end()) |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 271 return; | 271 return; |
| 272 | 272 |
| 273 PP_Var received_var(message_data.Get(this)); | 273 PP_Var received_var(message_data.Get(this)); |
| 274 DCHECK(received_var.type == PP_VARTYPE_STRING); | 274 DCHECK(received_var.type == PP_VARTYPE_STRING); |
| 275 ppapi::VarTracker* tracker = ppapi::PpapiGlobals::Get()->GetVarTracker(); | 275 ppapi::VarTracker* tracker = ppapi::PpapiGlobals::Get()->GetVarTracker(); |
| 276 ppapi::StringVar* var = tracker->GetVar(received_var)->AsStringVar(); | 276 ppapi::StringVar* var = tracker->GetVar(received_var)->AsStringVar(); |
| 277 DCHECK(var); | 277 DCHECK(var); |
| 278 | 278 |
| 279 RenderViewImpl* render_view = it->second; | 279 RenderViewImpl* render_view = it->second; |
| 280 render_view->Send( | 280 render_view->Send( |
| 281 new BrowserPluginHostMsg_NavigateFromGuest( | 281 new OldBrowserPluginHostMsg_NavigateFromGuest( |
| 282 render_view->GetRoutingID(), | 282 render_view->GetRoutingID(), |
| 283 instance, | 283 instance, |
| 284 var->value())); | 284 var->value())); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void GuestToEmbedderChannel::OnHandleFilteredInputEvent( | 287 void GuestToEmbedderChannel::OnHandleFilteredInputEvent( |
| 288 PP_Instance instance, | 288 PP_Instance instance, |
| 289 const ppapi::InputEventData& data, | 289 const ppapi::InputEventData& data, |
| 290 PP_Bool* result) { | 290 PP_Bool* result) { |
| 291 if (render_view_instances_.find(instance) == render_view_instances_.end()) | 291 if (render_view_instances_.find(instance) == render_view_instances_.end()) |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 306 render_view->GetWebView()->loseCompositorContext(1); | 306 render_view->GetWebView()->loseCompositorContext(1); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void GuestToEmbedderChannel::OnGuestReady(PP_Instance instance, | 309 void GuestToEmbedderChannel::OnGuestReady(PP_Instance instance, |
| 310 int embedder_container_id) { | 310 int embedder_container_id) { |
| 311 RenderThreadImpl::current()->browser_plugin_channel_manager()-> | 311 RenderThreadImpl::current()->browser_plugin_channel_manager()-> |
| 312 GuestReady(instance, embedder_channel_name(), embedder_container_id); | 312 GuestReady(instance, embedder_channel_name(), embedder_container_id); |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace content | 315 } // namespace content |
| OLD | NEW |