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/browser_plugin_manager_impl.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
6 | 6 |
7 #include "content/common/browser_plugin_messages.h" | 7 #include "content/common/browser_plugin_messages.h" |
8 #include "content/renderer/browser_plugin/browser_plugin.h" | 8 #include "content/renderer/browser_plugin/browser_plugin.h" |
9 #include "content/renderer/render_thread_impl.h" | 9 #include "content/renderer/render_thread_impl.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 bool BrowserPluginManagerImpl::OnControlMessageReceived( | 33 bool BrowserPluginManagerImpl::OnControlMessageReceived( |
34 const IPC::Message& message) { | 34 const IPC::Message& message) { |
35 DCHECK(CalledOnValidThread()); | 35 DCHECK(CalledOnValidThread()); |
36 bool handled = true; | 36 bool handled = true; |
37 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message) | 37 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message) |
38 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateRect, OnUpdateRect) | 38 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateRect, OnUpdateRect) |
39 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestCrashed, OnGuestCrashed) | 39 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestCrashed, OnGuestCrashed) |
40 IPC_MESSAGE_HANDLER(BrowserPluginMsg_DidNavigate, OnDidNavigate) | 40 IPC_MESSAGE_HANDLER(BrowserPluginMsg_DidNavigate, OnDidNavigate) |
41 IPC_MESSAGE_HANDLER(BrowserPluginMsg_AdvanceFocus, OnAdvanceFocus) | 41 IPC_MESSAGE_HANDLER(BrowserPluginMsg_AdvanceFocus, OnAdvanceFocus) |
| 42 IPC_MESSAGE_HANDLER(BrowserPluginMsg_ReceiveMessage, OnReceiveMessage) |
42 IPC_MESSAGE_UNHANDLED(handled = false) | 43 IPC_MESSAGE_UNHANDLED(handled = false) |
43 IPC_END_MESSAGE_MAP() | 44 IPC_END_MESSAGE_MAP() |
44 return handled; | 45 return handled; |
45 } | 46 } |
46 | 47 |
47 void BrowserPluginManagerImpl::OnUpdateRect( | 48 void BrowserPluginManagerImpl::OnUpdateRect( |
48 int instance_id, | 49 int instance_id, |
49 int message_id, | 50 int message_id, |
50 const BrowserPluginMsg_UpdateRect_Params& params) { | 51 const BrowserPluginMsg_UpdateRect_Params& params) { |
51 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); | 52 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); |
(...skipping 12 matching lines...) Expand all Loading... |
64 if (plugin) | 65 if (plugin) |
65 plugin->DidNavigate(url); | 66 plugin->DidNavigate(url); |
66 } | 67 } |
67 | 68 |
68 void BrowserPluginManagerImpl::OnAdvanceFocus(int instance_id, bool reverse) { | 69 void BrowserPluginManagerImpl::OnAdvanceFocus(int instance_id, bool reverse) { |
69 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); | 70 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); |
70 if (plugin) | 71 if (plugin) |
71 plugin->AdvanceFocus(reverse); | 72 plugin->AdvanceFocus(reverse); |
72 } | 73 } |
73 | 74 |
| 75 void BrowserPluginManagerImpl::OnReceiveMessage(int instance_id, |
| 76 int source_routing_id, |
| 77 const string16& source_origin, |
| 78 const string16& data) { |
| 79 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); |
| 80 if (plugin) |
| 81 plugin->ReceiveMessage(source_routing_id, source_origin, data); |
| 82 } |
| 83 |
74 } // namespace content | 84 } // namespace content |
OLD | NEW |