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/npapi/webplugin_delegate_proxy.h" | 5 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, | 443 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, |
444 OnGetWindowScriptNPObject) | 444 OnGetWindowScriptNPObject) |
445 IPC_MESSAGE_HANDLER(PluginHostMsg_GetPluginElement, OnGetPluginElement) | 445 IPC_MESSAGE_HANDLER(PluginHostMsg_GetPluginElement, OnGetPluginElement) |
446 IPC_MESSAGE_HANDLER(PluginHostMsg_ResolveProxy, OnResolveProxy) | 446 IPC_MESSAGE_HANDLER(PluginHostMsg_ResolveProxy, OnResolveProxy) |
447 IPC_MESSAGE_HANDLER(PluginHostMsg_SetCookie, OnSetCookie) | 447 IPC_MESSAGE_HANDLER(PluginHostMsg_SetCookie, OnSetCookie) |
448 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCookies, OnGetCookies) | 448 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCookies, OnGetCookies) |
449 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) | 449 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) |
450 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) | 450 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) |
451 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, | 451 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, |
452 OnInitiateHTTPRangeRequest) | 452 OnInitiateHTTPRangeRequest) |
| 453 IPC_MESSAGE_HANDLER(PluginHostMsg_DidStartLoading, OnDidStartLoading) |
| 454 IPC_MESSAGE_HANDLER(PluginHostMsg_DidStopLoading, OnDidStopLoading) |
453 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, | 455 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, |
454 OnDeferResourceLoading) | 456 OnDeferResourceLoading) |
455 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse, | 457 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse, |
456 OnURLRedirectResponse) | 458 OnURLRedirectResponse) |
457 IPC_MESSAGE_HANDLER(PluginHostMsg_CheckIfRunInsecureContent, | 459 IPC_MESSAGE_HANDLER(PluginHostMsg_CheckIfRunInsecureContent, |
458 OnCheckIfRunInsecureContent) | 460 OnCheckIfRunInsecureContent) |
459 #if defined(OS_WIN) | 461 #if defined(OS_WIN) |
460 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessData, OnSetWindowlessData) | 462 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessData, OnSetWindowlessData) |
461 IPC_MESSAGE_HANDLER(PluginHostMsg_NotifyIMEStatus, OnNotifyIMEStatus) | 463 IPC_MESSAGE_HANDLER(PluginHostMsg_NotifyIMEStatus, OnNotifyIMEStatus) |
462 #endif | 464 #endif |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 new ResourceClientProxy(channel_host_.get(), instance_id_); | 1118 new ResourceClientProxy(channel_host_.get(), instance_id_); |
1117 proxy->InitializeForSeekableStream(resource_id, range_request_id); | 1119 proxy->InitializeForSeekableStream(resource_id, range_request_id); |
1118 return proxy; | 1120 return proxy; |
1119 } | 1121 } |
1120 | 1122 |
1121 void WebPluginDelegateProxy::FetchURL(unsigned long resource_id, | 1123 void WebPluginDelegateProxy::FetchURL(unsigned long resource_id, |
1122 int notify_id, | 1124 int notify_id, |
1123 const GURL& url, | 1125 const GURL& url, |
1124 const GURL& first_party_for_cookies, | 1126 const GURL& first_party_for_cookies, |
1125 const std::string& method, | 1127 const std::string& method, |
1126 const std::string& post_data, | 1128 const char* buf, |
| 1129 unsigned int len, |
1127 const GURL& referrer, | 1130 const GURL& referrer, |
1128 bool notify_redirects, | 1131 bool notify_redirects, |
1129 bool is_plugin_src_load, | 1132 bool is_plugin_src_load, |
1130 int origin_pid, | 1133 int origin_pid, |
1131 int render_view_id) { | 1134 int render_view_id) { |
1132 PluginMsg_FetchURL_Params params; | 1135 PluginMsg_FetchURL_Params params; |
1133 params.resource_id = resource_id; | 1136 params.resource_id = resource_id; |
1134 params.notify_id = notify_id; | 1137 params.notify_id = notify_id; |
1135 params.url = url; | 1138 params.url = url; |
1136 params.first_party_for_cookies = first_party_for_cookies; | 1139 params.first_party_for_cookies = first_party_for_cookies; |
1137 params.method = method; | 1140 params.method = method; |
1138 params.post_data = post_data; | 1141 if (len) { |
| 1142 params.post_data.resize(len); |
| 1143 memcpy(¶ms.post_data.front(), buf, len); |
| 1144 } |
1139 params.referrer = referrer; | 1145 params.referrer = referrer; |
1140 params.notify_redirect = notify_redirects; | 1146 params.notify_redirect = notify_redirects; |
1141 params.is_plugin_src_load = is_plugin_src_load; | 1147 params.is_plugin_src_load = is_plugin_src_load; |
1142 params.render_view_id = render_view_id; | 1148 params.render_view_id = render_view_id; |
1143 Send(new PluginMsg_FetchURL(instance_id_, params)); | 1149 Send(new PluginMsg_FetchURL(instance_id_, params)); |
1144 } | 1150 } |
1145 | 1151 |
1146 #if defined(OS_MACOSX) | 1152 #if defined(OS_MACOSX) |
1147 void WebPluginDelegateProxy::OnFocusChanged(bool focused) { | 1153 void WebPluginDelegateProxy::OnFocusChanged(bool focused) { |
1148 if (render_view_) | 1154 if (render_view_) |
(...skipping 15 matching lines...) Expand all Loading... |
1164 } | 1170 } |
1165 | 1171 |
1166 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 1172 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
1167 const std::string& url, | 1173 const std::string& url, |
1168 const std::string& range_info, | 1174 const std::string& range_info, |
1169 int range_request_id) { | 1175 int range_request_id) { |
1170 plugin_->InitiateHTTPRangeRequest( | 1176 plugin_->InitiateHTTPRangeRequest( |
1171 url.c_str(), range_info.c_str(), range_request_id); | 1177 url.c_str(), range_info.c_str(), range_request_id); |
1172 } | 1178 } |
1173 | 1179 |
| 1180 void WebPluginDelegateProxy::OnDidStartLoading() { |
| 1181 plugin_->DidStartLoading(); |
| 1182 } |
| 1183 |
| 1184 void WebPluginDelegateProxy::OnDidStopLoading() { |
| 1185 plugin_->DidStopLoading(); |
| 1186 } |
| 1187 |
1174 void WebPluginDelegateProxy::OnDeferResourceLoading(unsigned long resource_id, | 1188 void WebPluginDelegateProxy::OnDeferResourceLoading(unsigned long resource_id, |
1175 bool defer) { | 1189 bool defer) { |
1176 plugin_->SetDeferResourceLoading(resource_id, defer); | 1190 plugin_->SetDeferResourceLoading(resource_id, defer); |
1177 } | 1191 } |
1178 | 1192 |
1179 #if defined(OS_MACOSX) | 1193 #if defined(OS_MACOSX) |
1180 void WebPluginDelegateProxy::OnAcceleratedPluginEnabledRendering() { | 1194 void WebPluginDelegateProxy::OnAcceleratedPluginEnabledRendering() { |
1181 uses_compositor_ = true; | 1195 uses_compositor_ = true; |
1182 OnSetWindow(gfx::kNullPluginWindow); | 1196 OnSetWindow(gfx::kNullPluginWindow); |
1183 } | 1197 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 | 1241 |
1228 plugin_->URLRedirectResponse(allow, resource_id); | 1242 plugin_->URLRedirectResponse(allow, resource_id); |
1229 } | 1243 } |
1230 | 1244 |
1231 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, | 1245 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, |
1232 bool* result) { | 1246 bool* result) { |
1233 *result = plugin_->CheckIfRunInsecureContent(url); | 1247 *result = plugin_->CheckIfRunInsecureContent(url); |
1234 } | 1248 } |
1235 | 1249 |
1236 } // namespace content | 1250 } // namespace content |
OLD | NEW |