| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 | 8 |
| 9 #include "generated_resources.h" | 9 #include "generated_resources.h" |
| 10 | 10 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 return NPN_RetainObject(npobject_); | 538 return NPN_RetainObject(npobject_); |
| 539 | 539 |
| 540 int route_id = MSG_ROUTING_NONE; | 540 int route_id = MSG_ROUTING_NONE; |
| 541 void* npobject_ptr; | 541 void* npobject_ptr; |
| 542 Send(new PluginMsg_GetPluginScriptableObject( | 542 Send(new PluginMsg_GetPluginScriptableObject( |
| 543 instance_id_, &route_id, &npobject_ptr)); | 543 instance_id_, &route_id, &npobject_ptr)); |
| 544 if (route_id == MSG_ROUTING_NONE) | 544 if (route_id == MSG_ROUTING_NONE) |
| 545 return NULL; | 545 return NULL; |
| 546 | 546 |
| 547 npobject_ = NPObjectProxy::Create( | 547 npobject_ = NPObjectProxy::Create( |
| 548 channel_host_.get(), route_id, npobject_ptr, NULL); | 548 channel_host_.get(), route_id, npobject_ptr, |
| 549 render_view_->modal_dialog_event()); |
| 549 | 550 |
| 550 return NPN_RetainObject(npobject_); | 551 return NPN_RetainObject(npobject_); |
| 551 } | 552 } |
| 552 | 553 |
| 553 void WebPluginDelegateProxy::DidFinishLoadWithReason(NPReason reason) { | 554 void WebPluginDelegateProxy::DidFinishLoadWithReason(NPReason reason) { |
| 554 Send(new PluginMsg_DidFinishLoadWithReason(instance_id_, reason)); | 555 Send(new PluginMsg_DidFinishLoadWithReason(instance_id_, reason)); |
| 555 } | 556 } |
| 556 | 557 |
| 557 void WebPluginDelegateProxy::SetFocus() { | 558 void WebPluginDelegateProxy::SetFocus() { |
| 558 Send(new PluginMsg_SetFocus(instance_id_)); | 559 Send(new PluginMsg_SetFocus(instance_id_)); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 *success = false; | 612 *success = false; |
| 612 NPObject* npobject = NULL; | 613 NPObject* npobject = NULL; |
| 613 if (plugin_) | 614 if (plugin_) |
| 614 npobject = plugin_->GetWindowScriptNPObject(); | 615 npobject = plugin_->GetWindowScriptNPObject(); |
| 615 | 616 |
| 616 if (!npobject) | 617 if (!npobject) |
| 617 return; | 618 return; |
| 618 | 619 |
| 619 // The stub will delete itself when the proxy tells it that it's released, or | 620 // The stub will delete itself when the proxy tells it that it's released, or |
| 620 // otherwise when the channel is closed. | 621 // otherwise when the channel is closed. |
| 621 NPObjectStub* stub = new NPObjectStub(npobject, channel_host_.get(), | 622 NPObjectStub* stub = new NPObjectStub( |
| 622 route_id); | 623 npobject, channel_host_.get(), route_id, |
| 624 render_view_->modal_dialog_event()); |
| 623 window_script_object_ = stub; | 625 window_script_object_ = stub; |
| 624 window_script_object_->set_proxy(this); | 626 window_script_object_->set_proxy(this); |
| 625 *success = true; | 627 *success = true; |
| 626 *npobject_ptr = npobject; | 628 *npobject_ptr = npobject; |
| 627 } | 629 } |
| 628 | 630 |
| 629 void WebPluginDelegateProxy::OnGetPluginElement( | 631 void WebPluginDelegateProxy::OnGetPluginElement( |
| 630 int route_id, bool* success, void** npobject_ptr) { | 632 int route_id, bool* success, void** npobject_ptr) { |
| 631 *success = false; | 633 *success = false; |
| 632 NPObject* npobject = NULL; | 634 NPObject* npobject = NULL; |
| 633 if (plugin_) | 635 if (plugin_) |
| 634 npobject = plugin_->GetPluginElement(); | 636 npobject = plugin_->GetPluginElement(); |
| 635 if (!npobject) | 637 if (!npobject) |
| 636 return; | 638 return; |
| 637 | 639 |
| 638 // The stub will delete itself when the proxy tells it that it's released, or | 640 // The stub will delete itself when the proxy tells it that it's released, or |
| 639 // otherwise when the channel is closed. | 641 // otherwise when the channel is closed. |
| 640 NPObjectStub* stub = new NPObjectStub(npobject, channel_host_.get(), | 642 NPObjectStub* stub = new NPObjectStub( |
| 641 route_id); | 643 npobject, channel_host_.get(), route_id, |
| 644 render_view_->modal_dialog_event()); |
| 642 *success = true; | 645 *success = true; |
| 643 *npobject_ptr = npobject; | 646 *npobject_ptr = npobject; |
| 644 } | 647 } |
| 645 | 648 |
| 646 void WebPluginDelegateProxy::OnSetCookie(const GURL& url, | 649 void WebPluginDelegateProxy::OnSetCookie(const GURL& url, |
| 647 const GURL& policy_url, | 650 const GURL& policy_url, |
| 648 const std::string& cookie) { | 651 const std::string& cookie) { |
| 649 if (plugin_) | 652 if (plugin_) |
| 650 plugin_->SetCookie(url, policy_url, cookie); | 653 plugin_->SetCookie(url, policy_url, cookie); |
| 651 } | 654 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 plugin_->CancelDocumentLoad(); | 757 plugin_->CancelDocumentLoad(); |
| 755 } | 758 } |
| 756 | 759 |
| 757 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 760 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 758 const std::string& url, const std::string& range_info, | 761 const std::string& url, const std::string& range_info, |
| 759 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { | 762 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { |
| 760 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 763 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 761 existing_stream, notify_needed, | 764 existing_stream, notify_needed, |
| 762 notify_data); | 765 notify_data); |
| 763 } | 766 } |
| OLD | NEW |