| 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_embedder_helper.h" | 5 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" |
| 6 | 6 |
| 7 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 7 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 9 #include "content/common/browser_plugin_messages.h" | 9 #include "content/common/browser_plugin_messages.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool BrowserPluginEmbedderHelper::Send(IPC::Message* message) { | 28 bool BrowserPluginEmbedderHelper::Send(IPC::Message* message) { |
| 29 return RenderViewHostObserver::Send(message); | 29 return RenderViewHostObserver::Send(message); |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool BrowserPluginEmbedderHelper::OnMessageReceived( | 32 bool BrowserPluginEmbedderHelper::OnMessageReceived( |
| 33 const IPC::Message& message) { | 33 const IPC::Message& message) { |
| 34 bool handled = true; | 34 bool handled = true; |
| 35 IPC_BEGIN_MESSAGE_MAP(BrowserPluginEmbedderHelper, message) | 35 IPC_BEGIN_MESSAGE_MAP(BrowserPluginEmbedderHelper, message) |
| 36 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_CreateGuest, |
| 37 OnCreateGuest); |
| 36 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_NavigateGuest, | 38 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_NavigateGuest, |
| 37 OnNavigateGuest); | 39 OnNavigateGuest); |
| 38 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ResizeGuest, OnResizeGuest) | 40 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ResizeGuest, OnResizeGuest) |
| 39 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateRect_ACK, OnUpdateRectACK); | 41 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateRect_ACK, OnUpdateRectACK); |
| 40 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetFocus, OnSetFocus); | 42 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetFocus, OnSetFocus); |
| 41 IPC_MESSAGE_HANDLER_GENERIC(BrowserPluginHostMsg_HandleInputEvent, | 43 IPC_MESSAGE_HANDLER_GENERIC(BrowserPluginHostMsg_HandleInputEvent, |
| 42 OnHandleInputEvent(*static_cast<const IPC::SyncMessage*>(&message), | 44 OnHandleInputEvent(*static_cast<const IPC::SyncMessage*>(&message), |
| 43 &handled)) | 45 &handled)) |
| 44 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_PluginDestroyed, | 46 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_PluginDestroyed, |
| 45 OnPluginDestroyed); | 47 OnPluginDestroyed); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 92 |
| 91 IPC::Message* reply_message = | 93 IPC::Message* reply_message = |
| 92 IPC::SyncMessage::GenerateReply(&message); | 94 IPC::SyncMessage::GenerateReply(&message); |
| 93 embedder_->HandleInputEvent(instance_id, | 95 embedder_->HandleInputEvent(instance_id, |
| 94 rvh, | 96 rvh, |
| 95 guest_screen_rect, | 97 guest_screen_rect, |
| 96 *input_event, | 98 *input_event, |
| 97 reply_message); | 99 reply_message); |
| 98 } | 100 } |
| 99 | 101 |
| 102 void BrowserPluginEmbedderHelper::OnCreateGuest( |
| 103 int instance_id, |
| 104 const std::string& storage_partition_id, |
| 105 bool persist_storage) { |
| 106 embedder_->CreateGuest(render_view_host(), |
| 107 instance_id, |
| 108 storage_partition_id, |
| 109 persist_storage); |
| 110 } |
| 111 |
| 100 void BrowserPluginEmbedderHelper::OnNavigateGuest( | 112 void BrowserPluginEmbedderHelper::OnNavigateGuest( |
| 101 int instance_id, | 113 int instance_id, |
| 102 const std::string& src, | 114 const std::string& src, |
| 103 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { | 115 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { |
| 104 embedder_->NavigateGuest(render_view_host(), | 116 embedder_->NavigateGuest(render_view_host(), |
| 105 instance_id, | 117 instance_id, |
| 106 src, | 118 src, |
| 107 resize_params); | 119 resize_params); |
| 108 } | 120 } |
| 109 | 121 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 127 | 139 |
| 128 void BrowserPluginEmbedderHelper::OnStop(int instance_id) { | 140 void BrowserPluginEmbedderHelper::OnStop(int instance_id) { |
| 129 embedder_->Stop(instance_id); | 141 embedder_->Stop(instance_id); |
| 130 } | 142 } |
| 131 | 143 |
| 132 void BrowserPluginEmbedderHelper::OnReload(int instance_id) { | 144 void BrowserPluginEmbedderHelper::OnReload(int instance_id) { |
| 133 embedder_->Reload(instance_id); | 145 embedder_->Reload(instance_id); |
| 134 } | 146 } |
| 135 | 147 |
| 136 } // namespace content | 148 } // namespace content |
| OLD | NEW |