| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <atlbase.h> | 10 #include <atlbase.h> |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 } | 603 } |
| 604 | 604 |
| 605 void WebPluginDelegateProxy::DidFinishLoadWithReason(NPReason reason) { | 605 void WebPluginDelegateProxy::DidFinishLoadWithReason(NPReason reason) { |
| 606 Send(new PluginMsg_DidFinishLoadWithReason(instance_id_, reason)); | 606 Send(new PluginMsg_DidFinishLoadWithReason(instance_id_, reason)); |
| 607 } | 607 } |
| 608 | 608 |
| 609 void WebPluginDelegateProxy::SetFocus() { | 609 void WebPluginDelegateProxy::SetFocus() { |
| 610 Send(new PluginMsg_SetFocus(instance_id_)); | 610 Send(new PluginMsg_SetFocus(instance_id_)); |
| 611 } | 611 } |
| 612 | 612 |
| 613 bool WebPluginDelegateProxy::HandleEvent(NPEvent* event, WebCursor* cursor) { | 613 bool WebPluginDelegateProxy::HandleInputEvent( |
| 614 const WebKit::WebInputEvent& event, |
| 615 WebCursor* cursor) { |
| 614 bool handled; | 616 bool handled; |
| 615 // A windowless plugin can enter a modal loop in the context of a | 617 // A windowless plugin can enter a modal loop in the context of a |
| 616 // NPP_HandleEvent call, in which case we need to pump messages to | 618 // NPP_HandleEvent call, in which case we need to pump messages to |
| 617 // the plugin. We pass of the corresponding event handle to the | 619 // the plugin. We pass of the corresponding event handle to the |
| 618 // plugin process, which is set if the plugin does enter a modal loop. | 620 // plugin process, which is set if the plugin does enter a modal loop. |
| 619 IPC::SyncMessage* message = new PluginMsg_HandleEvent(instance_id_, | 621 IPC::SyncMessage* message = new PluginMsg_HandleInputEvent( |
| 620 *event, &handled, | 622 instance_id_, &event, &handled, cursor); |
| 621 cursor); | |
| 622 message->set_pump_messages_event(modal_loop_pump_messages_event_.get()); | 623 message->set_pump_messages_event(modal_loop_pump_messages_event_.get()); |
| 623 Send(message); | 624 Send(message); |
| 624 return handled; | 625 return handled; |
| 625 } | 626 } |
| 626 | 627 |
| 627 int WebPluginDelegateProxy::GetProcessId() { | 628 int WebPluginDelegateProxy::GetProcessId() { |
| 628 return channel_host_->peer_pid(); | 629 return channel_host_->peer_pid(); |
| 629 } | 630 } |
| 630 | 631 |
| 631 void WebPluginDelegateProxy::OnSetWindow(gfx::NativeViewId window_id) { | 632 void WebPluginDelegateProxy::OnSetWindow(gfx::NativeViewId window_id) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 plugin_->CancelDocumentLoad(); | 825 plugin_->CancelDocumentLoad(); |
| 825 } | 826 } |
| 826 | 827 |
| 827 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 828 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 828 const std::string& url, const std::string& range_info, | 829 const std::string& url, const std::string& range_info, |
| 829 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { | 830 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { |
| 830 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 831 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 831 existing_stream, notify_needed, | 832 existing_stream, notify_needed, |
| 832 notify_data); | 833 notify_data); |
| 833 } | 834 } |
| OLD | NEW |