| 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 | 6 |
| 7 #include "Cursor.h" | |
| 8 #include "Document.h" | 7 #include "Document.h" |
| 9 #include "DocumentLoader.h" | 8 #include "DocumentLoader.h" |
| 10 #include "Event.h" | 9 #include "Event.h" |
| 11 #include "EventNames.h" | 10 #include "EventNames.h" |
| 12 #include "FloatPoint.h" | 11 #include "FloatPoint.h" |
| 13 #include "FormData.h" | 12 #include "FormData.h" |
| 14 #include "FormState.h" | 13 #include "FormState.h" |
| 15 #include "FocusController.h" | 14 #include "FocusController.h" |
| 16 #include "Frame.h" | 15 #include "Frame.h" |
| 17 #include "FrameLoader.h" | 16 #include "FrameLoader.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 41 #include "ScrollView.h" | 40 #include "ScrollView.h" |
| 42 #include "Widget.h" | 41 #include "Widget.h" |
| 43 | 42 |
| 44 #undef LOG | 43 #undef LOG |
| 45 #include "base/gfx/rect.h" | 44 #include "base/gfx/rect.h" |
| 46 #include "base/logging.h" | 45 #include "base/logging.h" |
| 47 #include "base/message_loop.h" | 46 #include "base/message_loop.h" |
| 48 #include "base/string_util.h" | 47 #include "base/string_util.h" |
| 49 #include "base/sys_string_conversions.h" | 48 #include "base/sys_string_conversions.h" |
| 50 #include "net/base/escape.h" | 49 #include "net/base/escape.h" |
| 50 #include "webkit/api/public/WebCursorInfo.h" |
| 51 #include "webkit/api/public/WebData.h" | 51 #include "webkit/api/public/WebData.h" |
| 52 #include "webkit/api/public/WebHTTPBody.h" | 52 #include "webkit/api/public/WebHTTPBody.h" |
| 53 #include "webkit/api/public/WebInputEvent.h" | 53 #include "webkit/api/public/WebInputEvent.h" |
| 54 #include "webkit/api/public/WebKit.h" | 54 #include "webkit/api/public/WebKit.h" |
| 55 #include "webkit/api/public/WebKitClient.h" | 55 #include "webkit/api/public/WebKitClient.h" |
| 56 #include "webkit/api/public/WebString.h" | 56 #include "webkit/api/public/WebString.h" |
| 57 #include "webkit/api/public/WebURL.h" | 57 #include "webkit/api/public/WebURL.h" |
| 58 #include "webkit/api/public/WebURLLoader.h" | 58 #include "webkit/api/public/WebURLLoader.h" |
| 59 #include "webkit/api/public/WebURLLoaderClient.h" | 59 #include "webkit/api/public/WebURLLoaderClient.h" |
| 60 #include "webkit/api/public/WebURLResponse.h" | 60 #include "webkit/api/public/WebURLResponse.h" |
| 61 #include "webkit/glue/chrome_client_impl.h" | 61 #include "webkit/glue/chrome_client_impl.h" |
| 62 #include "webkit/glue/event_conversion.h" | 62 #include "webkit/glue/event_conversion.h" |
| 63 #include "webkit/glue/glue_util.h" | 63 #include "webkit/glue/glue_util.h" |
| 64 #include "webkit/glue/multipart_response_delegate.h" | 64 #include "webkit/glue/multipart_response_delegate.h" |
| 65 #include "webkit/glue/webcursor.h" | |
| 66 #include "webkit/glue/webkit_glue.h" | 65 #include "webkit/glue/webkit_glue.h" |
| 67 #include "webkit/glue/webplugin_impl.h" | 66 #include "webkit/glue/webplugin_impl.h" |
| 68 #include "webkit/glue/plugins/plugin_host.h" | 67 #include "webkit/glue/plugins/plugin_host.h" |
| 69 #include "webkit/glue/plugins/plugin_instance.h" | 68 #include "webkit/glue/plugins/plugin_instance.h" |
| 70 #include "webkit/glue/stacking_order_iterator.h" | 69 #include "webkit/glue/stacking_order_iterator.h" |
| 71 #include "webkit/glue/webplugin_delegate.h" | 70 #include "webkit/glue/webplugin_delegate.h" |
| 72 #include "webkit/glue/webview_impl.h" | 71 #include "webkit/glue/webview_impl.h" |
| 73 #include "googleurl/src/gurl.h" | 72 #include "googleurl/src/gurl.h" |
| 74 | 73 |
| 74 using WebKit::WebCursorInfo; |
| 75 using WebKit::WebData; | 75 using WebKit::WebData; |
| 76 using WebKit::WebHTTPBody; | 76 using WebKit::WebHTTPBody; |
| 77 using WebKit::WebInputEvent; | 77 using WebKit::WebInputEvent; |
| 78 using WebKit::WebKeyboardEvent; | 78 using WebKit::WebKeyboardEvent; |
| 79 using WebKit::WebMouseEvent; | 79 using WebKit::WebMouseEvent; |
| 80 using WebKit::WebString; | 80 using WebKit::WebString; |
| 81 using WebKit::WebURLError; | 81 using WebKit::WebURLError; |
| 82 using WebKit::WebURLLoader; | 82 using WebKit::WebURLLoader; |
| 83 using WebKit::WebURLLoaderClient; | 83 using WebKit::WebURLLoaderClient; |
| 84 using WebKit::WebURLRequest; | 84 using WebKit::WebURLRequest; |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 if (WebCore::Page* current_page = containing_frame->page()) { | 871 if (WebCore::Page* current_page = containing_frame->page()) { |
| 872 current_page->focusController()->setFocusedFrame(containing_frame); | 872 current_page->focusController()->setFocusedFrame(containing_frame); |
| 873 } | 873 } |
| 874 // Give focus to our containing HTMLPluginElement. | 874 // Give focus to our containing HTMLPluginElement. |
| 875 containing_frame->document()->setFocusedNode(element_); | 875 containing_frame->document()->setFocusedNode(element_); |
| 876 } | 876 } |
| 877 | 877 |
| 878 // TODO(pkasting): http://b/1119691 This conditional seems exactly backwards, | 878 // TODO(pkasting): http://b/1119691 This conditional seems exactly backwards, |
| 879 // but it matches Safari's code, and if I reverse it, giving focus to a | 879 // but it matches Safari's code, and if I reverse it, giving focus to a |
| 880 // transparent (windowless) plugin fails. | 880 // transparent (windowless) plugin fails. |
| 881 WebCursor cursor; | 881 WebCursorInfo cursor_info; |
| 882 if (!delegate_->HandleInputEvent(web_event, &cursor)) | 882 if (!delegate_->HandleInputEvent(web_event, &cursor_info)) |
| 883 event->setDefaultHandled(); | 883 event->setDefaultHandled(); |
| 884 | 884 |
| 885 WebCore::Page* page = parent_view->frame()->page(); | 885 WebCore::Page* page = parent_view->frame()->page(); |
| 886 if (!page) | 886 if (!page) |
| 887 return; | 887 return; |
| 888 | 888 |
| 889 ChromeClientImpl* chrome_client = | 889 ChromeClientImpl* chrome_client = |
| 890 static_cast<ChromeClientImpl*>(page->chrome()->client()); | 890 static_cast<ChromeClientImpl*>(page->chrome()->client()); |
| 891 | 891 |
| 892 // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE | 892 // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE |
| 893 // event. We need to reflect the changed cursor in the frame view as the | 893 // event. We need to reflect the changed cursor in the frame view as the |
| 894 // mouse is moved in the boundaries of the windowless plugin. | 894 // mouse is moved in the boundaries of the windowless plugin. |
| 895 chrome_client->SetCursorForPlugin(cursor); | 895 chrome_client->SetCursorForPlugin(cursor_info); |
| 896 } | 896 } |
| 897 | 897 |
| 898 void WebPluginImpl::handleKeyboardEvent(WebCore::KeyboardEvent* event) { | 898 void WebPluginImpl::handleKeyboardEvent(WebCore::KeyboardEvent* event) { |
| 899 WebKeyboardEvent web_event; | 899 WebKeyboardEvent web_event; |
| 900 if (!ToWebKeyboardEvent(*event, &web_event)) | 900 if (!ToWebKeyboardEvent(*event, &web_event)) |
| 901 return; | 901 return; |
| 902 // TODO(pkasting): http://b/1119691 See above. | 902 // TODO(pkasting): http://b/1119691 See above. |
| 903 WebCursor current_web_cursor; | 903 WebCursorInfo cursor_info; |
| 904 if (!delegate_->HandleInputEvent(web_event, ¤t_web_cursor)) | 904 if (!delegate_->HandleInputEvent(web_event, &cursor_info)) |
| 905 event->setDefaultHandled(); | 905 event->setDefaultHandled(); |
| 906 } | 906 } |
| 907 | 907 |
| 908 NPObject* WebPluginImpl::GetPluginScriptableObject() { | 908 NPObject* WebPluginImpl::GetPluginScriptableObject() { |
| 909 return delegate_->GetPluginScriptableObject(); | 909 return delegate_->GetPluginScriptableObject(); |
| 910 } | 910 } |
| 911 | 911 |
| 912 WebPluginResourceClient* WebPluginImpl::GetClientFromLoader( | 912 WebPluginResourceClient* WebPluginImpl::GetClientFromLoader( |
| 913 WebURLLoader* loader) { | 913 WebURLLoader* loader) { |
| 914 for (size_t i = 0; i < clients_.size(); ++i) { | 914 for (size_t i = 0; i < clients_.size(); ++i) { |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 | 1430 |
| 1431 WebPluginGeometry move; | 1431 WebPluginGeometry move; |
| 1432 move.window = window_; | 1432 move.window = window_; |
| 1433 move.window_rect = gfx::Rect(); | 1433 move.window_rect = gfx::Rect(); |
| 1434 move.clip_rect = gfx::Rect(); | 1434 move.clip_rect = gfx::Rect(); |
| 1435 move.rects_valid = false; | 1435 move.rects_valid = false; |
| 1436 move.visible = widget_->isVisible(); | 1436 move.visible = widget_->isVisible(); |
| 1437 | 1437 |
| 1438 webview->delegate()->DidMove(webview, move); | 1438 webview->delegate()->DidMove(webview, move); |
| 1439 } | 1439 } |
| OLD | NEW |