Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest_helper.cc

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed crash + cleanup Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_helper.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" 8 #include "content/browser/browser_plugin/browser_plugin_guest.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h" 9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/browser/web_contents/web_contents_impl.h" 10 #include "content/browser/web_contents/web_contents_impl.h"
(...skipping 17 matching lines...) Expand all
28 guest_(guest) { 28 guest_(guest) {
29 } 29 }
30 30
31 BrowserPluginGuestHelper::~BrowserPluginGuestHelper() { 31 BrowserPluginGuestHelper::~BrowserPluginGuestHelper() {
32 } 32 }
33 33
34 bool BrowserPluginGuestHelper::OnMessageReceived( 34 bool BrowserPluginGuestHelper::OnMessageReceived(
35 const IPC::Message& message) { 35 const IPC::Message& message) {
36 bool handled = true; 36 bool handled = true;
37 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message) 37 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message)
38 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent)
39 IPC_MESSAGE_UNHANDLED(handled = false)
40 IPC_END_MESSAGE_MAP()
41
42 if (static_cast<RenderViewHostImpl*>(render_view_host())->is_swapped_out()) {
43 return handled;
44 }
45
46 handled = true;
47 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message)
38 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 48 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
39 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck) 49 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck)
40 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) 50 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
41 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) 51 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget)
42 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) 52 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
43 IPC_MESSAGE_UNHANDLED(handled = false) 53 IPC_MESSAGE_UNHANDLED(handled = false)
44 IPC_END_MESSAGE_MAP() 54 IPC_END_MESSAGE_MAP()
45 return handled; 55 return handled;
46 } 56 }
47 57
(...skipping 14 matching lines...) Expand all
62 72
63 void BrowserPluginGuestHelper::OnShowWidget(int route_id, 73 void BrowserPluginGuestHelper::OnShowWidget(int route_id,
64 const gfx::Rect& initial_pos) { 74 const gfx::Rect& initial_pos) {
65 guest_->ShowWidget(render_view_host(), route_id, initial_pos); 75 guest_->ShowWidget(render_view_host(), route_id, initial_pos);
66 } 76 }
67 77
68 void BrowserPluginGuestHelper::OnSetCursor(const WebCursor& cursor) { 78 void BrowserPluginGuestHelper::OnSetCursor(const WebCursor& cursor) {
69 guest_->SetCursor(cursor); 79 guest_->SetCursor(cursor);
70 } 80 }
71 81
82 void BrowserPluginGuestHelper::OnRouteMessageEvent(
83 const ViewMsg_PostMessage_Params& params) {
84 guest_->RouteMessageEvent(params);
85 }
86
72 } // namespace content 87 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698