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 "webkit/glue/plugins/webplugin_delegate_impl.h" | 5 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
11 #include <gdk/gdkx.h> | 11 #include <gdk/gdkx.h> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
17 #include "base/stats_counters.h" | 17 #include "base/stats_counters.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
| 19 #include "webkit/api/public/WebCursorInfo.h" |
19 #include "webkit/api/public/WebInputEvent.h" | 20 #include "webkit/api/public/WebInputEvent.h" |
20 // #include "webkit/default_plugin/plugin_impl.h" | 21 // #include "webkit/default_plugin/plugin_impl.h" |
21 #include "webkit/glue/glue_util.h" | 22 #include "webkit/glue/glue_util.h" |
22 #include "webkit/glue/webplugin.h" | 23 #include "webkit/glue/webplugin.h" |
23 #include "webkit/glue/plugins/gtk_plugin_container.h" | 24 #include "webkit/glue/plugins/gtk_plugin_container.h" |
24 #include "webkit/glue/plugins/plugin_constants_win.h" | 25 #include "webkit/glue/plugins/plugin_constants_win.h" |
25 #include "webkit/glue/plugins/plugin_instance.h" | 26 #include "webkit/glue/plugins/plugin_instance.h" |
26 #include "webkit/glue/plugins/plugin_lib.h" | 27 #include "webkit/glue/plugins/plugin_lib.h" |
27 #include "webkit/glue/plugins/plugin_list.h" | 28 #include "webkit/glue/plugins/plugin_list.h" |
28 #include "webkit/glue/plugins/plugin_stream_url.h" | 29 #include "webkit/glue/plugins/plugin_stream_url.h" |
29 #include "webkit/glue/webkit_glue.h" | 30 #include "webkit/glue/webkit_glue.h" |
30 #if defined(OS_LINUX) | 31 #if defined(OS_LINUX) |
31 #include "third_party/npapi/bindings/npapi_x11.h" | 32 #include "third_party/npapi/bindings/npapi_x11.h" |
32 #endif | 33 #endif |
33 | 34 |
| 35 using WebKit::WebCursorInfo; |
34 using WebKit::WebKeyboardEvent; | 36 using WebKit::WebKeyboardEvent; |
35 using WebKit::WebInputEvent; | 37 using WebKit::WebInputEvent; |
36 using WebKit::WebMouseEvent; | 38 using WebKit::WebMouseEvent; |
37 | 39 |
38 WebPluginDelegate* WebPluginDelegate::Create( | 40 WebPluginDelegate* WebPluginDelegate::Create( |
39 const FilePath& filename, | 41 const FilePath& filename, |
40 const std::string& mime_type, | 42 const std::string& mime_type, |
41 gfx::PluginWindowHandle containing_view) { | 43 gfx::PluginWindowHandle containing_view) { |
42 scoped_refptr<NPAPI::PluginLib> plugin = | 44 scoped_refptr<NPAPI::PluginLib> plugin = |
43 NPAPI::PluginLib::CreatePluginLib(filename); | 45 NPAPI::PluginLib::CreatePluginLib(filename); |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 return false; | 789 return false; |
788 } | 790 } |
789 return NPEventFromWebKeyboardEvent( | 791 return NPEventFromWebKeyboardEvent( |
790 *static_cast<const WebKeyboardEvent*>(&event), timestamp, np_event); | 792 *static_cast<const WebKeyboardEvent*>(&event), timestamp, np_event); |
791 default: | 793 default: |
792 return false; | 794 return false; |
793 } | 795 } |
794 } | 796 } |
795 | 797 |
796 bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event, | 798 bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event, |
797 WebCursor* cursor) { | 799 WebCursorInfo* cursor_info) { |
798 DCHECK(windowless_) << "events should only be received in windowless mode"; | 800 DCHECK(windowless_) << "events should only be received in windowless mode"; |
799 | 801 |
800 if (first_event_time_ < 0.0) | 802 if (first_event_time_ < 0.0) |
801 first_event_time_ = event.timeStampSeconds; | 803 first_event_time_ = event.timeStampSeconds; |
802 Time timestamp = static_cast<Time>( | 804 Time timestamp = static_cast<Time>( |
803 (event.timeStampSeconds - first_event_time_) * 1.0e3); | 805 (event.timeStampSeconds - first_event_time_) * 1.0e3); |
804 NPEvent np_event = {0}; | 806 NPEvent np_event = {0}; |
805 if (!NPEventFromWebInputEvent(event, timestamp, &np_event)) { | 807 if (!NPEventFromWebInputEvent(event, timestamp, &np_event)) { |
806 return false; | 808 return false; |
807 } | 809 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 return stream; | 845 return stream; |
844 } | 846 } |
845 | 847 |
846 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, | 848 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, |
847 bool notify_needed, | 849 bool notify_needed, |
848 intptr_t notify_data) { | 850 intptr_t notify_data) { |
849 if (notify_needed) { | 851 if (notify_needed) { |
850 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); | 852 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); |
851 } | 853 } |
852 } | 854 } |
OLD | NEW |