| 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 "config.h" | 5 #include "config.h" |
| 6 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 6 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/stats_counters.h" | 14 #include "base/stats_counters.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "webkit/api/public/WebInputEvent.h" | 16 #include "webkit/api/public/WebInputEvent.h" |
| 17 #include "webkit/default_plugin/plugin_impl.h" | 17 #include "webkit/default_plugin/plugin_impl.h" |
| 18 #include "webkit/glue/glue_util.h" | 18 #include "webkit/glue/glue_util.h" |
| 19 #include "webkit/glue/webplugin.h" | 19 #include "webkit/glue/webplugin.h" |
| 20 #include "webkit/glue/plugins/plugin_constants_win.h" | 20 #include "webkit/glue/plugins/plugin_constants_win.h" |
| 21 #include "webkit/glue/plugins/plugin_instance.h" | 21 #include "webkit/glue/plugins/plugin_instance.h" |
| 22 #include "webkit/glue/plugins/plugin_lib.h" | 22 #include "webkit/glue/plugins/plugin_lib.h" |
| 23 #include "webkit/glue/plugins/plugin_list.h" | 23 #include "webkit/glue/plugins/plugin_list.h" |
| 24 #include "webkit/glue/plugins/plugin_stream_url.h" | 24 #include "webkit/glue/plugins/plugin_stream_url.h" |
| 25 #include "webkit/glue/webkit_glue.h" | 25 #include "webkit/glue/webkit_glue.h" |
| 26 | 26 |
| 27 using WebKit::WebCursorInfo; |
| 27 using WebKit::WebKeyboardEvent; | 28 using WebKit::WebKeyboardEvent; |
| 28 using WebKit::WebInputEvent; | 29 using WebKit::WebInputEvent; |
| 29 using WebKit::WebMouseEvent; | 30 using WebKit::WebMouseEvent; |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 const wchar_t kWebPluginDelegateProperty[] = L"WebPluginDelegateProperty"; | 34 const wchar_t kWebPluginDelegateProperty[] = L"WebPluginDelegateProperty"; |
| 34 const wchar_t kPluginNameAtomProperty[] = L"PluginNameAtom"; | 35 const wchar_t kPluginNameAtomProperty[] = L"PluginNameAtom"; |
| 35 const wchar_t kDummyActivationWindowName[] = L"DummyWindowForActivation"; | 36 const wchar_t kDummyActivationWindowName[] = L"DummyWindowForActivation"; |
| 36 const wchar_t kPluginOrigProc[] = L"OriginalPtr"; | 37 const wchar_t kPluginOrigProc[] = L"OriginalPtr"; |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 394 |
| 394 void WebPluginDelegateImpl::SetFocus() { | 395 void WebPluginDelegateImpl::SetFocus() { |
| 395 DCHECK(instance()->windowless()); | 396 DCHECK(instance()->windowless()); |
| 396 | 397 |
| 397 NPEvent focus_event; | 398 NPEvent focus_event; |
| 398 | 399 |
| 399 instance()->NPP_HandleEvent(&focus_event); | 400 instance()->NPP_HandleEvent(&focus_event); |
| 400 } | 401 } |
| 401 | 402 |
| 402 bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event, | 403 bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event, |
| 403 WebCursor* cursor) { | 404 WebCursorInfo* cursor) { |
| 404 DCHECK(windowless_) << "events should only be received in windowless mode"; | 405 DCHECK(windowless_) << "events should only be received in windowless mode"; |
| 405 DCHECK(cursor != NULL); | 406 DCHECK(cursor != NULL); |
| 406 // TODO: convert event into a NPEvent, and call NPP_HandleEvent(np_event). | 407 // TODO: convert event into a NPEvent, and call NPP_HandleEvent(np_event). |
| 407 | 408 |
| 408 return true; | 409 return true; |
| 409 } | 410 } |
| 410 | 411 |
| 411 WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( | 412 WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( |
| 412 int resource_id, const std::string &url, bool notify_needed, | 413 int resource_id, const std::string &url, bool notify_needed, |
| 413 intptr_t notify_data, intptr_t existing_stream) { | 414 intptr_t notify_data, intptr_t existing_stream) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 432 return stream; | 433 return stream; |
| 433 } | 434 } |
| 434 | 435 |
| 435 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, | 436 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, |
| 436 bool notify_needed, | 437 bool notify_needed, |
| 437 intptr_t notify_data) { | 438 intptr_t notify_data) { |
| 438 if (notify_needed) { | 439 if (notify_needed) { |
| 439 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); | 440 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); |
| 440 } | 441 } |
| 441 } | 442 } |
| OLD | NEW |