| 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 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/common/render_messages.h" | 23 #include "chrome/common/render_messages.h" |
| 24 #include "chrome/plugin/npobject_proxy.h" | 24 #include "chrome/plugin/npobject_proxy.h" |
| 25 #include "chrome/plugin/npobject_stub.h" | 25 #include "chrome/plugin/npobject_stub.h" |
| 26 #include "chrome/plugin/npobject_util.h" | 26 #include "chrome/plugin/npobject_util.h" |
| 27 #include "chrome/renderer/render_thread.h" | 27 #include "chrome/renderer/render_thread.h" |
| 28 #include "chrome/renderer/render_view.h" | 28 #include "chrome/renderer/render_view.h" |
| 29 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
| 30 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
| 31 #include "net/base/mime_util.h" | 31 #include "net/base/mime_util.h" |
| 32 #include "printing/native_metafile.h" | 32 #include "printing/native_metafile.h" |
| 33 #include "webkit/api/public/WebCursorInfo.h" |
| 33 #include "webkit/api/public/WebDragData.h" | 34 #include "webkit/api/public/WebDragData.h" |
| 34 #include "webkit/api/public/WebString.h" | 35 #include "webkit/api/public/WebString.h" |
| 35 #include "webkit/api/public/WebVector.h" | 36 #include "webkit/api/public/WebVector.h" |
| 36 #include "webkit/glue/webframe.h" | 37 #include "webkit/glue/webframe.h" |
| 37 #include "webkit/glue/webkit_glue.h" | 38 #include "webkit/glue/webkit_glue.h" |
| 38 #include "webkit/glue/webplugin.h" | 39 #include "webkit/glue/webplugin.h" |
| 39 #include "webkit/glue/webview.h" | 40 #include "webkit/glue/webview.h" |
| 40 | 41 |
| 41 #if defined(OS_POSIX) | 42 #if defined(OS_POSIX) |
| 42 #include "chrome/common/ipc_channel_posix.h" | 43 #include "chrome/common/ipc_channel_posix.h" |
| 43 #endif | 44 #endif |
| 44 | 45 |
| 46 using WebKit::WebCursorInfo; |
| 45 using WebKit::WebInputEvent; | 47 using WebKit::WebInputEvent; |
| 46 using WebKit::WebDragData; | 48 using WebKit::WebDragData; |
| 47 using WebKit::WebVector; | 49 using WebKit::WebVector; |
| 48 using WebKit::WebString; | 50 using WebKit::WebString; |
| 49 | 51 |
| 50 // Proxy for WebPluginResourceClient. The object owns itself after creation, | 52 // Proxy for WebPluginResourceClient. The object owns itself after creation, |
| 51 // deleting itself after its callback has been called. | 53 // deleting itself after its callback has been called. |
| 52 class ResourceClientProxy : public WebPluginResourceClient { | 54 class ResourceClientProxy : public WebPluginResourceClient { |
| 53 public: | 55 public: |
| 54 ResourceClientProxy(PluginChannelHost* channel, int instance_id) | 56 ResourceClientProxy(PluginChannelHost* channel, int instance_id) |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 void WebPluginDelegateProxy::DidFinishLoadWithReason(NPReason reason) { | 618 void WebPluginDelegateProxy::DidFinishLoadWithReason(NPReason reason) { |
| 617 Send(new PluginMsg_DidFinishLoadWithReason(instance_id_, reason)); | 619 Send(new PluginMsg_DidFinishLoadWithReason(instance_id_, reason)); |
| 618 } | 620 } |
| 619 | 621 |
| 620 void WebPluginDelegateProxy::SetFocus() { | 622 void WebPluginDelegateProxy::SetFocus() { |
| 621 Send(new PluginMsg_SetFocus(instance_id_)); | 623 Send(new PluginMsg_SetFocus(instance_id_)); |
| 622 } | 624 } |
| 623 | 625 |
| 624 bool WebPluginDelegateProxy::HandleInputEvent( | 626 bool WebPluginDelegateProxy::HandleInputEvent( |
| 625 const WebInputEvent& event, | 627 const WebInputEvent& event, |
| 626 WebCursor* cursor) { | 628 WebCursorInfo* cursor_info) { |
| 627 bool handled; | 629 bool handled; |
| 630 WebCursor cursor; |
| 628 // A windowless plugin can enter a modal loop in the context of a | 631 // A windowless plugin can enter a modal loop in the context of a |
| 629 // NPP_HandleEvent call, in which case we need to pump messages to | 632 // NPP_HandleEvent call, in which case we need to pump messages to |
| 630 // the plugin. We pass of the corresponding event handle to the | 633 // the plugin. We pass of the corresponding event handle to the |
| 631 // plugin process, which is set if the plugin does enter a modal loop. | 634 // plugin process, which is set if the plugin does enter a modal loop. |
| 632 IPC::SyncMessage* message = new PluginMsg_HandleInputEvent( | 635 IPC::SyncMessage* message = new PluginMsg_HandleInputEvent( |
| 633 instance_id_, &event, &handled, cursor); | 636 instance_id_, &event, &handled, &cursor); |
| 634 message->set_pump_messages_event(modal_loop_pump_messages_event_.get()); | 637 message->set_pump_messages_event(modal_loop_pump_messages_event_.get()); |
| 635 Send(message); | 638 Send(message); |
| 639 cursor.GetCursorInfo(cursor_info); |
| 636 return handled; | 640 return handled; |
| 637 } | 641 } |
| 638 | 642 |
| 639 int WebPluginDelegateProxy::GetProcessId() { | 643 int WebPluginDelegateProxy::GetProcessId() { |
| 640 return channel_host_->peer_pid(); | 644 return channel_host_->peer_pid(); |
| 641 } | 645 } |
| 642 | 646 |
| 643 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { | 647 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { |
| 644 windowless_ = !window; | 648 windowless_ = !window; |
| 645 if (plugin_) | 649 if (plugin_) |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 plugin_->CancelDocumentLoad(); | 937 plugin_->CancelDocumentLoad(); |
| 934 } | 938 } |
| 935 | 939 |
| 936 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 940 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 937 const std::string& url, const std::string& range_info, | 941 const std::string& url, const std::string& range_info, |
| 938 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { | 942 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { |
| 939 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 943 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 940 existing_stream, notify_needed, | 944 existing_stream, notify_needed, |
| 941 notify_data); | 945 notify_data); |
| 942 } | 946 } |
| OLD | NEW |