OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "bindings/v8/PageScriptDebugServer.h" | 37 #include "bindings/v8/PageScriptDebugServer.h" |
38 #include "bindings/v8/ScriptController.h" | 38 #include "bindings/v8/ScriptController.h" |
39 #include "bindings/v8/V8Binding.h" | 39 #include "bindings/v8/V8Binding.h" |
40 #include "core/dom/ExceptionCode.h" | 40 #include "core/dom/ExceptionCode.h" |
41 #include "core/fetch/MemoryCache.h" | 41 #include "core/fetch/MemoryCache.h" |
42 #include "core/frame/FrameView.h" | 42 #include "core/frame/FrameView.h" |
43 #include "core/frame/LocalFrame.h" | 43 #include "core/frame/LocalFrame.h" |
44 #include "core/frame/Settings.h" | 44 #include "core/frame/Settings.h" |
45 #include "core/inspector/InjectedScriptHost.h" | 45 #include "core/inspector/InjectedScriptHost.h" |
46 #include "core/inspector/InspectorController.h" | 46 #include "core/inspector/InspectorController.h" |
| 47 #include "core/page/FocusController.h" |
47 #include "core/page/Page.h" | 48 #include "core/page/Page.h" |
48 #include "core/rendering/RenderView.h" | 49 #include "core/rendering/RenderView.h" |
49 #include "platform/JSONValues.h" | 50 #include "platform/JSONValues.h" |
50 #include "platform/graphics/GraphicsContext.h" | 51 #include "platform/graphics/GraphicsContext.h" |
51 #include "platform/network/ResourceError.h" | 52 #include "platform/network/ResourceError.h" |
52 #include "platform/network/ResourceRequest.h" | 53 #include "platform/network/ResourceRequest.h" |
53 #include "platform/network/ResourceResponse.h" | 54 #include "platform/network/ResourceResponse.h" |
54 #include "public/platform/Platform.h" | 55 #include "public/platform/Platform.h" |
55 #include "public/platform/WebRect.h" | 56 #include "public/platform/WebRect.h" |
56 #include "public/platform/WebString.h" | 57 #include "public/platform/WebString.h" |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 } | 574 } |
574 | 575 |
575 void WebDevToolsAgentImpl::processGPUEvent(const GPUEvent& event) | 576 void WebDevToolsAgentImpl::processGPUEvent(const GPUEvent& event) |
576 { | 577 { |
577 if (InspectorController* ic = inspectorController()) | 578 if (InspectorController* ic = inspectorController()) |
578 ic->processGPUEvent(event.timestamp, event.phase, event.foreign, event.u
sedGPUMemoryBytes, event.limitGPUMemoryBytes); | 579 ic->processGPUEvent(event.timestamp, event.phase, event.foreign, event.u
sedGPUMemoryBytes, event.limitGPUMemoryBytes); |
579 } | 580 } |
580 | 581 |
581 void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event) | 582 void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event) |
582 { | 583 { |
| 584 if (!m_webViewImpl->page()->focusController().isFocused()) |
| 585 m_webViewImpl->setFocus(true); |
| 586 |
583 m_generatingEvent = true; | 587 m_generatingEvent = true; |
584 WebKeyboardEvent webEvent = WebKeyboardEventBuilder(event); | 588 WebKeyboardEvent webEvent = WebKeyboardEventBuilder(event); |
585 if (!webEvent.keyIdentifier[0] && webEvent.type != WebInputEvent::Char) | 589 if (!webEvent.keyIdentifier[0] && webEvent.type != WebInputEvent::Char) |
586 webEvent.setKeyIdentifierFromWindowsKeyCode(); | 590 webEvent.setKeyIdentifierFromWindowsKeyCode(); |
587 m_webViewImpl->handleInputEvent(webEvent); | 591 m_webViewImpl->handleInputEvent(webEvent); |
588 m_generatingEvent = false; | 592 m_generatingEvent = false; |
589 } | 593 } |
590 | 594 |
591 void WebDevToolsAgentImpl::dispatchMouseEvent(const PlatformMouseEvent& event) | 595 void WebDevToolsAgentImpl::dispatchMouseEvent(const PlatformMouseEvent& event) |
592 { | 596 { |
| 597 if (!m_webViewImpl->page()->focusController().isFocused()) |
| 598 m_webViewImpl->setFocus(true); |
| 599 |
593 m_generatingEvent = true; | 600 m_generatingEvent = true; |
594 WebMouseEvent webEvent = WebMouseEventBuilder(m_webViewImpl->mainFrameImpl()
->frameView(), event); | 601 WebMouseEvent webEvent = WebMouseEventBuilder(m_webViewImpl->mainFrameImpl()
->frameView(), event); |
595 m_webViewImpl->handleInputEvent(webEvent); | 602 m_webViewImpl->handleInputEvent(webEvent); |
596 m_generatingEvent = false; | 603 m_generatingEvent = false; |
597 } | 604 } |
598 | 605 |
599 void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message) | 606 void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message) |
600 { | 607 { |
601 inspectorController()->dispatchMessageFromFrontend(message); | 608 inspectorController()->dispatchMessageFromFrontend(message); |
602 } | 609 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 728 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
722 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 729 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
723 } | 730 } |
724 | 731 |
725 void WebDevToolsAgent::processPendingMessages() | 732 void WebDevToolsAgent::processPendingMessages() |
726 { | 733 { |
727 PageScriptDebugServer::shared().runPendingTasks(); | 734 PageScriptDebugServer::shared().runPendingTasks(); |
728 } | 735 } |
729 | 736 |
730 } // namespace blink | 737 } // namespace blink |
OLD | NEW |