OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 406 } |
407 | 407 |
408 void WebPluginDelegateProxy::DidFinishManualLoading() { | 408 void WebPluginDelegateProxy::DidFinishManualLoading() { |
409 Send(new PluginMsg_DidFinishManualLoading(instance_id_)); | 409 Send(new PluginMsg_DidFinishManualLoading(instance_id_)); |
410 } | 410 } |
411 | 411 |
412 void WebPluginDelegateProxy::DidManualLoadFail() { | 412 void WebPluginDelegateProxy::DidManualLoadFail() { |
413 Send(new PluginMsg_DidManualLoadFail(instance_id_)); | 413 Send(new PluginMsg_DidManualLoadFail(instance_id_)); |
414 } | 414 } |
415 | 415 |
416 void WebPluginDelegateProxy::InstallMissingPlugin() { | |
417 Send(new PluginMsg_InstallMissingPlugin(instance_id_)); | |
418 } | |
419 | |
420 bool WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { | 416 bool WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { |
421 content::GetContentClient()->SetActiveURL(page_url_); | 417 content::GetContentClient()->SetActiveURL(page_url_); |
422 | 418 |
423 bool handled = true; | 419 bool handled = true; |
424 IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg) | 420 IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg) |
425 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow) | 421 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow) |
426 #if defined(OS_WIN) | 422 #if defined(OS_WIN) |
427 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent, | 423 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent, |
428 OnSetWindowlessPumpEvent) | 424 OnSetWindowlessPumpEvent) |
429 #endif | 425 #endif |
430 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource) | 426 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource) |
431 IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect) | 427 IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect) |
432 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, | 428 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, |
433 OnGetWindowScriptNPObject) | 429 OnGetWindowScriptNPObject) |
434 IPC_MESSAGE_HANDLER(PluginHostMsg_GetPluginElement, | 430 IPC_MESSAGE_HANDLER(PluginHostMsg_GetPluginElement, |
435 OnGetPluginElement) | 431 OnGetPluginElement) |
436 IPC_MESSAGE_HANDLER(PluginHostMsg_SetCookie, OnSetCookie) | 432 IPC_MESSAGE_HANDLER(PluginHostMsg_SetCookie, OnSetCookie) |
437 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCookies, OnGetCookies) | 433 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCookies, OnGetCookies) |
438 IPC_MESSAGE_HANDLER(PluginHostMsg_MissingPluginStatus, | |
439 OnMissingPluginStatus) | |
440 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) | 434 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) |
441 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) | 435 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) |
442 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, | 436 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, |
443 OnInitiateHTTPRangeRequest) | 437 OnInitiateHTTPRangeRequest) |
444 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, | 438 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, |
445 OnDeferResourceLoading) | 439 OnDeferResourceLoading) |
446 | 440 |
447 #if defined(OS_MACOSX) | 441 #if defined(OS_MACOSX) |
448 IPC_MESSAGE_HANDLER(PluginHostMsg_FocusChanged, | 442 IPC_MESSAGE_HANDLER(PluginHostMsg_FocusChanged, |
449 OnFocusChanged); | 443 OnFocusChanged); |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 } | 1116 } |
1123 | 1117 |
1124 void WebPluginDelegateProxy::OnGetCookies(const GURL& url, | 1118 void WebPluginDelegateProxy::OnGetCookies(const GURL& url, |
1125 const GURL& first_party_for_cookies, | 1119 const GURL& first_party_for_cookies, |
1126 std::string* cookies) { | 1120 std::string* cookies) { |
1127 DCHECK(cookies); | 1121 DCHECK(cookies); |
1128 if (plugin_) | 1122 if (plugin_) |
1129 *cookies = plugin_->GetCookies(url, first_party_for_cookies); | 1123 *cookies = plugin_->GetCookies(url, first_party_for_cookies); |
1130 } | 1124 } |
1131 | 1125 |
1132 void WebPluginDelegateProxy::OnMissingPluginStatus(int status) { | |
1133 if (render_view_) | |
1134 render_view_->OnMissingPluginStatus(this, status); | |
1135 } | |
1136 | |
1137 void WebPluginDelegateProxy::PaintSadPlugin(WebKit::WebCanvas* native_context, | 1126 void WebPluginDelegateProxy::PaintSadPlugin(WebKit::WebCanvas* native_context, |
1138 const gfx::Rect& rect) { | 1127 const gfx::Rect& rect) { |
1139 // Lazily load the sad plugin image. | 1128 // Lazily load the sad plugin image. |
1140 if (!sad_plugin_) | 1129 if (!sad_plugin_) |
1141 sad_plugin_ = content::GetContentClient()->renderer()->GetSadPluginBitmap(); | 1130 sad_plugin_ = content::GetContentClient()->renderer()->GetSadPluginBitmap(); |
1142 if (sad_plugin_) | 1131 if (sad_plugin_) |
1143 webkit::PaintSadPlugin(native_context, plugin_rect_, *sad_plugin_); | 1132 webkit::PaintSadPlugin(native_context, plugin_rect_, *sad_plugin_); |
1144 } | 1133 } |
1145 | 1134 |
1146 void WebPluginDelegateProxy::CopyFromBackBufferToFrontBuffer( | 1135 void WebPluginDelegateProxy::CopyFromBackBufferToFrontBuffer( |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 } | 1379 } |
1391 #endif | 1380 #endif |
1392 | 1381 |
1393 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1382 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1394 int resource_id) { | 1383 int resource_id) { |
1395 if (!plugin_) | 1384 if (!plugin_) |
1396 return; | 1385 return; |
1397 | 1386 |
1398 plugin_->URLRedirectResponse(allow, resource_id); | 1387 plugin_->URLRedirectResponse(allow, resource_id); |
1399 } | 1388 } |
OLD | NEW |