Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: Source/web/ChromeClientImpl.cpp

Issue 642203002: Make input event forwarding work in --site-per-process. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix merge conflict. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 26 matching lines...) Expand all
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" 42 #include "core/events/KeyboardEvent.h"
43 #include "core/events/MouseEvent.h" 43 #include "core/events/MouseEvent.h"
44 #include "core/events/WheelEvent.h" 44 #include "core/events/WheelEvent.h"
45 #include "core/frame/Console.h" 45 #include "core/frame/Console.h"
46 #include "core/frame/FrameView.h" 46 #include "core/frame/FrameView.h"
47 #include "core/frame/RemoteFrame.h"
48 #include "core/frame/RemoteFrameView.h"
47 #include "core/frame/Settings.h" 49 #include "core/frame/Settings.h"
48 #include "core/html/HTMLInputElement.h" 50 #include "core/html/HTMLInputElement.h"
49 #include "core/html/forms/ColorChooser.h" 51 #include "core/html/forms/ColorChooser.h"
50 #include "core/html/forms/ColorChooserClient.h" 52 #include "core/html/forms/ColorChooserClient.h"
51 #include "core/html/forms/DateTimeChooser.h" 53 #include "core/html/forms/DateTimeChooser.h"
52 #include "core/loader/DocumentLoader.h" 54 #include "core/loader/DocumentLoader.h"
53 #include "core/loader/FrameLoadRequest.h" 55 #include "core/loader/FrameLoadRequest.h"
54 #include "core/page/Page.h" 56 #include "core/page/Page.h"
55 #include "core/page/PagePopupDriver.h" 57 #include "core/page/PagePopupDriver.h"
56 #include "core/page/WindowFeatures.h" 58 #include "core/page/WindowFeatures.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #include "web/ColorChooserUIController.h" 98 #include "web/ColorChooserUIController.h"
97 #include "web/DateTimeChooserImpl.h" 99 #include "web/DateTimeChooserImpl.h"
98 #include "web/ExternalDateTimeChooser.h" 100 #include "web/ExternalDateTimeChooser.h"
99 #include "web/ExternalPopupMenu.h" 101 #include "web/ExternalPopupMenu.h"
100 #include "web/PopupMenuChromium.h" 102 #include "web/PopupMenuChromium.h"
101 #include "web/WebFileChooserCompletionImpl.h" 103 #include "web/WebFileChooserCompletionImpl.h"
102 #include "web/WebInputEventConversion.h" 104 #include "web/WebInputEventConversion.h"
103 #include "web/WebLocalFrameImpl.h" 105 #include "web/WebLocalFrameImpl.h"
104 #include "web/WebPluginContainerImpl.h" 106 #include "web/WebPluginContainerImpl.h"
105 #include "web/WebPopupMenuImpl.h" 107 #include "web/WebPopupMenuImpl.h"
108 #include "web/WebRemoteFrameImpl.h"
106 #include "web/WebSettingsImpl.h" 109 #include "web/WebSettingsImpl.h"
107 #include "web/WebViewImpl.h" 110 #include "web/WebViewImpl.h"
108 #include "wtf/text/CString.h" 111 #include "wtf/text/CString.h"
109 #include "wtf/text/StringBuilder.h" 112 #include "wtf/text/StringBuilder.h"
110 #include "wtf/text/StringConcatenate.h" 113 #include "wtf/text/StringConcatenate.h"
111 #include "wtf/unicode/CharacterNames.h" 114 #include "wtf/unicode/CharacterNames.h"
112 115
113 namespace blink { 116 namespace blink {
114 117
115 // Converts a AXObjectCache::AXNotification to a WebAXEvent 118 // Converts a AXObjectCache::AXNotification to a WebAXEvent
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle ment, KeyboardEvent& event) 841 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle ment, KeyboardEvent& event)
839 { 842 {
840 if (!m_webView->autofillClient()) 843 if (!m_webView->autofillClient())
841 return; 844 return;
842 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&inp utElement), WebKeyboardEventBuilder(event)); 845 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&inp utElement), WebKeyboardEventBuilder(event));
843 } 846 }
844 847
845 // FIXME: Remove this code once we have input routing in the browser 848 // FIXME: Remove this code once we have input routing in the browser
846 // process. See http://crbug.com/339659. 849 // process. See http://crbug.com/339659.
847 void ChromeClientImpl::forwardInputEvent( 850 void ChromeClientImpl::forwardInputEvent(
848 Frame* frame, Event* event) 851 RemoteFrame* frame, Event* event)
849 { 852 {
850 // FIXME: Input event forwarding to out-of-process frames is broken until 853 WebRemoteFrameImpl* webFrame = WebRemoteFrameImpl::fromFrame(*frame);
851 // WebRemoteFrameImpl has a WebFrameClient.
852 if (frame->isRemoteFrame())
853 return;
854
855 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(toLocalFrame(fram e));
856 854
857 // This is only called when we have out-of-process iframes, which 855 // This is only called when we have out-of-process iframes, which
858 // need to forward input events across processes. 856 // need to forward input events across processes.
859 // FIXME: Add a check for out-of-process iframes enabled. 857 // FIXME: Add a check for out-of-process iframes enabled.
860 if (event->isKeyboardEvent()) { 858 if (event->isKeyboardEvent()) {
861 WebKeyboardEventBuilder webEvent(*static_cast<KeyboardEvent*>(event)); 859 WebKeyboardEventBuilder webEvent(*static_cast<KeyboardEvent*>(event));
862 webFrame->client()->forwardInputEvent(&webEvent); 860 webFrame->client()->forwardInputEvent(&webEvent);
863 } else if (event->isMouseEvent()) { 861 } else if (event->isMouseEvent()) {
864 WebMouseEventBuilder webEvent(webFrame->frameView(), frame->ownerRendere r(), *static_cast<MouseEvent*>(event)); 862 WebMouseEventBuilder webEvent(webFrame->frame()->view(), frame->ownerRen derer(), *static_cast<MouseEvent*>(event));
865 // Internal Blink events should not be forwarded. 863 // Internal Blink events should not be forwarded.
866 if (webEvent.type == WebInputEvent::Undefined) 864 if (webEvent.type == WebInputEvent::Undefined)
867 return; 865 return;
868
869 webFrame->client()->forwardInputEvent(&webEvent); 866 webFrame->client()->forwardInputEvent(&webEvent);
870 } else if (event->isWheelEvent()) { 867 } else if (event->isWheelEvent()) {
871 WebMouseWheelEventBuilder webEvent(webFrame->frameView(), frame->ownerRe nderer(), *static_cast<WheelEvent*>(event)); 868 WebMouseWheelEventBuilder webEvent(webFrame->frame()->view(), frame->own erRenderer(), *static_cast<WheelEvent*>(event));
872 if (webEvent.type == WebInputEvent::Undefined) 869 if (webEvent.type == WebInputEvent::Undefined)
873 return; 870 return;
874 webFrame->client()->forwardInputEvent(&webEvent); 871 webFrame->client()->forwardInputEvent(&webEvent);
875 } 872 }
876 } 873 }
877 874
878 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element ) 875 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element )
879 { 876 {
880 if (!m_webView->autofillClient()) 877 if (!m_webView->autofillClient())
881 return; 878 return;
882 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme nt)); 879 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme nt));
883 } 880 }
884 881
885 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement) 882 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement)
886 { 883 {
887 if (m_webView->autofillClient()) 884 if (m_webView->autofillClient())
888 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp utElement)); 885 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp utElement));
889 } 886 }
890 887
891 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) 888 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input)
892 { 889 {
893 if (m_webView->autofillClient()) 890 if (m_webView->autofillClient())
894 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put)); 891 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put));
895 } 892 }
896 893
897 } // namespace blink 894 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698