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/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 RecordAction(UserMetricsAction("BrowserPlugin.Guest.AbnormalDeath")); | 346 RecordAction(UserMetricsAction("BrowserPlugin.Guest.AbnormalDeath")); |
347 break; | 347 break; |
348 default: | 348 default: |
349 break; | 349 break; |
350 } | 350 } |
351 } | 351 } |
352 | 352 |
353 bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) { | 353 bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) { |
354 bool handled = true; | 354 bool handled = true; |
355 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuest, message) | 355 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuest, message) |
| 356 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWindow, OnCreateWindow) |
356 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck) | 357 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck) |
357 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, | 358 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, |
358 OnHasTouchEventHandlers) | 359 OnHasTouchEventHandlers) |
359 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) | 360 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) |
360 #if defined(OS_MACOSX) | 361 #if defined(OS_MACOSX) |
361 // MacOSX creates and populates platform-specific select drop-down menus | 362 // MacOSX creates and populates platform-specific select drop-down menus |
362 // whereas other platforms merely create a popup window that the guest | 363 // whereas other platforms merely create a popup window that the guest |
363 // renderer process paints inside. | 364 // renderer process paints inside. |
364 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) | 365 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) |
365 #endif | 366 #endif |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 void BrowserPluginGuest::OnUpdateRectACK( | 522 void BrowserPluginGuest::OnUpdateRectACK( |
522 int instance_id, | 523 int instance_id, |
523 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 524 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
524 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params) { | 525 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params) { |
525 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); | 526 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); |
526 render_view_host->Send( | 527 render_view_host->Send( |
527 new ViewMsg_UpdateRect_ACK(render_view_host->GetRoutingID())); | 528 new ViewMsg_UpdateRect_ACK(render_view_host->GetRoutingID())); |
528 OnSetSize(instance_id_, auto_size_params, resize_guest_params); | 529 OnSetSize(instance_id_, auto_size_params, resize_guest_params); |
529 } | 530 } |
530 | 531 |
| 532 void BrowserPluginGuest::OnCreateWindow( |
| 533 const ViewHostMsg_CreateWindow_Params& params, |
| 534 int* route_id, |
| 535 int* surface_id, |
| 536 int64* cloned_session_storage_namespace_id) { |
| 537 // TODO(fsamuel): We do not currently support window.open. |
| 538 // See http://crbug.com/140316. |
| 539 *route_id = MSG_ROUTING_NONE; |
| 540 *surface_id = 0; |
| 541 *cloned_session_storage_namespace_id = 0l; |
| 542 } |
| 543 |
531 void BrowserPluginGuest::OnHandleInputEventAck( | 544 void BrowserPluginGuest::OnHandleInputEventAck( |
532 WebKit::WebInputEvent::Type event_type, | 545 WebKit::WebInputEvent::Type event_type, |
533 InputEventAckState ack_result) { | 546 InputEventAckState ack_result) { |
534 RenderViewHostImpl* guest_rvh = | 547 RenderViewHostImpl* guest_rvh = |
535 static_cast<RenderViewHostImpl*>(web_contents()->GetRenderViewHost()); | 548 static_cast<RenderViewHostImpl*>(web_contents()->GetRenderViewHost()); |
536 guest_rvh->StopHangMonitorTimeout(); | 549 guest_rvh->StopHangMonitorTimeout(); |
537 } | 550 } |
538 | 551 |
539 void BrowserPluginGuest::OnHasTouchEventHandlers(bool accept) { | 552 void BrowserPluginGuest::OnHasTouchEventHandlers(bool accept) { |
540 SendMessageToEmbedder( | 553 SendMessageToEmbedder( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 relay_params.scroll_delta = params.scroll_delta; | 660 relay_params.scroll_delta = params.scroll_delta; |
648 relay_params.scroll_rect = params.scroll_rect; | 661 relay_params.scroll_rect = params.scroll_rect; |
649 relay_params.copy_rects = params.copy_rects; | 662 relay_params.copy_rects = params.copy_rects; |
650 | 663 |
651 SendMessageToEmbedder(new BrowserPluginMsg_UpdateRect(embedder_routing_id(), | 664 SendMessageToEmbedder(new BrowserPluginMsg_UpdateRect(embedder_routing_id(), |
652 instance_id(), | 665 instance_id(), |
653 relay_params)); | 666 relay_params)); |
654 } | 667 } |
655 | 668 |
656 } // namespace content | 669 } // namespace content |
OLD | NEW |