Index: Source/web/WebDevToolsAgentImpl.cpp |
=================================================================== |
--- Source/web/WebDevToolsAgentImpl.cpp (revision 175115) |
+++ Source/web/WebDevToolsAgentImpl.cpp (working copy) |
@@ -44,6 +44,7 @@ |
#include "core/frame/Settings.h" |
#include "core/inspector/InjectedScriptHost.h" |
#include "core/inspector/InspectorController.h" |
+#include "core/page/FocusController.h" |
#include "core/page/Page.h" |
#include "core/rendering/RenderView.h" |
#include "platform/JSONValues.h" |
@@ -559,6 +560,9 @@ |
void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event) |
{ |
+ if (!m_webViewImpl->page()->focusController().isFocused()) |
+ m_webViewImpl->setFocus(true); |
+ |
m_generatingEvent = true; |
WebKeyboardEvent webEvent = WebKeyboardEventBuilder(event); |
if (!webEvent.keyIdentifier[0] && webEvent.type != WebInputEvent::Char) |
@@ -569,6 +573,9 @@ |
void WebDevToolsAgentImpl::dispatchMouseEvent(const PlatformMouseEvent& event) |
{ |
+ if (!m_webViewImpl->page()->focusController().isFocused()) |
+ m_webViewImpl->setFocus(true); |
+ |
m_generatingEvent = true; |
WebMouseEvent webEvent = WebMouseEventBuilder(m_webViewImpl->mainFrameImpl()->frameView(), event); |
m_webViewImpl->handleInputEvent(webEvent); |