OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "config.h" | 32 #include "config.h" |
33 #include "web/ChromeClientImpl.h" | 33 #include "web/ChromeClientImpl.h" |
34 | 34 |
35 #include "bindings/core/v8/ScriptController.h" | 35 #include "bindings/core/v8/ScriptController.h" |
36 #include "core/HTMLNames.h" | 36 #include "core/HTMLNames.h" |
37 #include "core/accessibility/AXObject.h" | 37 #include "core/accessibility/AXObject.h" |
38 #include "core/accessibility/AXObjectCache.h" | 38 #include "core/accessibility/AXObjectCache.h" |
39 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
40 #include "core/dom/Fullscreen.h" | 40 #include "core/dom/Fullscreen.h" |
41 #include "core/dom/Node.h" | 41 #include "core/dom/Node.h" |
42 #include "core/events/KeyboardEvent.h" | |
43 #include "core/events/MouseEvent.h" | |
44 #include "core/events/WheelEvent.h" | |
45 #include "core/frame/Console.h" | 42 #include "core/frame/Console.h" |
46 #include "core/frame/FrameView.h" | 43 #include "core/frame/FrameView.h" |
47 #include "core/frame/RemoteFrame.h" | |
48 #include "core/frame/RemoteFrameView.h" | |
49 #include "core/frame/Settings.h" | 44 #include "core/frame/Settings.h" |
50 #include "core/html/HTMLInputElement.h" | 45 #include "core/html/HTMLInputElement.h" |
51 #include "core/html/forms/ColorChooser.h" | 46 #include "core/html/forms/ColorChooser.h" |
52 #include "core/html/forms/ColorChooserClient.h" | 47 #include "core/html/forms/ColorChooserClient.h" |
53 #include "core/html/forms/DateTimeChooser.h" | 48 #include "core/html/forms/DateTimeChooser.h" |
54 #include "core/loader/DocumentLoader.h" | 49 #include "core/loader/DocumentLoader.h" |
55 #include "core/loader/FrameLoadRequest.h" | 50 #include "core/loader/FrameLoadRequest.h" |
56 #include "core/page/Page.h" | 51 #include "core/page/Page.h" |
57 #include "core/page/PagePopupDriver.h" | 52 #include "core/page/PagePopupDriver.h" |
58 #include "core/page/WindowFeatures.h" | 53 #include "core/page/WindowFeatures.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 #include "web/ColorChooserUIController.h" | 91 #include "web/ColorChooserUIController.h" |
97 #include "web/DateTimeChooserImpl.h" | 92 #include "web/DateTimeChooserImpl.h" |
98 #include "web/ExternalDateTimeChooser.h" | 93 #include "web/ExternalDateTimeChooser.h" |
99 #include "web/ExternalPopupMenu.h" | 94 #include "web/ExternalPopupMenu.h" |
100 #include "web/PopupMenuChromium.h" | 95 #include "web/PopupMenuChromium.h" |
101 #include "web/WebFileChooserCompletionImpl.h" | 96 #include "web/WebFileChooserCompletionImpl.h" |
102 #include "web/WebInputEventConversion.h" | 97 #include "web/WebInputEventConversion.h" |
103 #include "web/WebLocalFrameImpl.h" | 98 #include "web/WebLocalFrameImpl.h" |
104 #include "web/WebPluginContainerImpl.h" | 99 #include "web/WebPluginContainerImpl.h" |
105 #include "web/WebPopupMenuImpl.h" | 100 #include "web/WebPopupMenuImpl.h" |
106 #include "web/WebRemoteFrameImpl.h" | |
107 #include "web/WebSettingsImpl.h" | 101 #include "web/WebSettingsImpl.h" |
108 #include "web/WebViewImpl.h" | 102 #include "web/WebViewImpl.h" |
109 #include "wtf/text/CString.h" | 103 #include "wtf/text/CString.h" |
110 #include "wtf/text/StringBuilder.h" | 104 #include "wtf/text/StringBuilder.h" |
111 #include "wtf/text/StringConcatenate.h" | 105 #include "wtf/text/StringConcatenate.h" |
112 #include "wtf/unicode/CharacterNames.h" | 106 #include "wtf/unicode/CharacterNames.h" |
113 | 107 |
114 namespace blink { | 108 namespace blink { |
115 | 109 |
116 // Converts a AXObjectCache::AXNotification to a WebAXEvent | 110 // Converts a AXObjectCache::AXNotification to a WebAXEvent |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 m_webView->client()->showImeIfNeeded(); | 830 m_webView->client()->showImeIfNeeded(); |
837 } | 831 } |
838 | 832 |
839 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle
ment, KeyboardEvent& event) | 833 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle
ment, KeyboardEvent& event) |
840 { | 834 { |
841 if (!m_webView->autofillClient()) | 835 if (!m_webView->autofillClient()) |
842 return; | 836 return; |
843 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&inp
utElement), WebKeyboardEventBuilder(event)); | 837 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&inp
utElement), WebKeyboardEventBuilder(event)); |
844 } | 838 } |
845 | 839 |
846 // FIXME: Remove this code once we have input routing in the browser | |
847 // process. See http://crbug.com/339659. | |
848 void ChromeClientImpl::forwardInputEvent( | |
849 RemoteFrame* frame, Event* event) | |
850 { | |
851 WebRemoteFrameImpl* webFrame = WebRemoteFrameImpl::fromFrame(*frame); | |
852 | |
853 // This is only called when we have out-of-process iframes, which | |
854 // need to forward input events across processes. | |
855 // FIXME: Add a check for out-of-process iframes enabled. | |
856 if (event->isKeyboardEvent()) { | |
857 WebKeyboardEventBuilder webEvent(*static_cast<KeyboardEvent*>(event)); | |
858 webFrame->client()->forwardInputEvent(&webEvent); | |
859 } else if (event->isMouseEvent()) { | |
860 WebMouseEventBuilder webEvent(webFrame->frame()->view(), frame->ownerRen
derer(), *static_cast<MouseEvent*>(event)); | |
861 // Internal Blink events should not be forwarded. | |
862 if (webEvent.type == WebInputEvent::Undefined) | |
863 return; | |
864 webFrame->client()->forwardInputEvent(&webEvent); | |
865 } else if (event->isWheelEvent()) { | |
866 WebMouseWheelEventBuilder webEvent(webFrame->frame()->view(), frame->own
erRenderer(), *static_cast<WheelEvent*>(event)); | |
867 if (webEvent.type == WebInputEvent::Undefined) | |
868 return; | |
869 webFrame->client()->forwardInputEvent(&webEvent); | |
870 } | |
871 } | |
872 | |
873 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element
) | 840 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element
) |
874 { | 841 { |
875 if (!m_webView->autofillClient()) | 842 if (!m_webView->autofillClient()) |
876 return; | 843 return; |
877 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme
nt)); | 844 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme
nt)); |
878 } | 845 } |
879 | 846 |
880 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement) | 847 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement) |
881 { | 848 { |
882 if (m_webView->autofillClient()) | 849 if (m_webView->autofillClient()) |
883 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp
utElement)); | 850 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp
utElement)); |
884 } | 851 } |
885 | 852 |
886 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) | 853 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) |
887 { | 854 { |
888 if (m_webView->autofillClient()) | 855 if (m_webView->autofillClient()) |
889 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in
put)); | 856 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in
put)); |
890 } | 857 } |
891 | 858 |
892 } // namespace blink | 859 } // namespace blink |
OLD | NEW |