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/guest_to_embedder_channel.h" | 5 #include "content/renderer/browser_plugin/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/browser_plugin_messages.h" |
9 #include "content/common/child_process.h" | 9 #include "content/common/child_process.h" |
10 #include "content/renderer/browser_plugin/browser_plugin_channel_manager.h" | 10 #include "content/renderer/browser_plugin/browser_plugin_channel_manager.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 render_view->Send( | 240 render_view->Send( |
241 new BrowserPluginHostMsg_ResizeGuest( | 241 new BrowserPluginHostMsg_ResizeGuest( |
242 render_view->GetRoutingID(), | 242 render_view->GetRoutingID(), |
243 new_data.rect.size.width, | 243 new_data.rect.size.width, |
244 new_data.rect.size.height)); | 244 new_data.rect.size.height)); |
245 } | 245 } |
246 } | 246 } |
247 | 247 |
248 void GuestToEmbedderChannel::OnDidChangeFocus(PP_Instance instance, | 248 void GuestToEmbedderChannel::OnDidChangeFocus(PP_Instance instance, |
249 PP_Bool has_focus) { | 249 PP_Bool has_focus) { |
250 NOTIMPLEMENTED(); | 250 InstanceMap::iterator it = render_view_instances_.find(instance); |
| 251 if (it == render_view_instances_.end()) |
| 252 return; |
| 253 RenderViewImpl* render_view = it->second; |
| 254 render_view->GetWebView()->setFocus(PP_ToBool(has_focus)); |
251 } | 255 } |
252 | 256 |
253 void GuestToEmbedderChannel::OnHandleMessage( | 257 void GuestToEmbedderChannel::OnHandleMessage( |
254 PP_Instance instance, | 258 PP_Instance instance, |
255 ppapi::proxy::SerializedVarReceiveInput message_data) { | 259 ppapi::proxy::SerializedVarReceiveInput message_data) { |
256 InstanceMap::iterator it = render_view_instances_.find(instance); | 260 InstanceMap::iterator it = render_view_instances_.find(instance); |
257 if (it == render_view_instances_.end()) | 261 if (it == render_view_instances_.end()) |
258 return; | 262 return; |
259 | 263 |
260 PP_Var received_var(message_data.Get(this)); | 264 PP_Var received_var(message_data.Get(this)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 render_view->GetWebView()->loseCompositorContext(1); | 297 render_view->GetWebView()->loseCompositorContext(1); |
294 } | 298 } |
295 | 299 |
296 void GuestToEmbedderChannel::OnGuestReady(PP_Instance instance, | 300 void GuestToEmbedderChannel::OnGuestReady(PP_Instance instance, |
297 int embedder_container_id) { | 301 int embedder_container_id) { |
298 RenderThreadImpl::current()->browser_plugin_channel_manager()-> | 302 RenderThreadImpl::current()->browser_plugin_channel_manager()-> |
299 GuestReady(instance, embedder_channel_name(), embedder_container_id); | 303 GuestReady(instance, embedder_channel_name(), embedder_container_id); |
300 } | 304 } |
301 | 305 |
302 } // namespace content | 306 } // namespace content |
OLD | NEW |