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

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

Issue 308813003: Merge 174628 "DevTools: Focus/blur events that are triggered by ..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1985/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } 553 }
553 554
554 void WebDevToolsAgentImpl::processGPUEvent(const GPUEvent& event) 555 void WebDevToolsAgentImpl::processGPUEvent(const GPUEvent& event)
555 { 556 {
556 if (InspectorController* ic = inspectorController()) 557 if (InspectorController* ic = inspectorController())
557 ic->processGPUEvent(event.timestamp, event.phase, event.foreign, event.u sedGPUMemoryBytes, event.limitGPUMemoryBytes); 558 ic->processGPUEvent(event.timestamp, event.phase, event.foreign, event.u sedGPUMemoryBytes, event.limitGPUMemoryBytes);
558 } 559 }
559 560
560 void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event) 561 void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event)
561 { 562 {
563 if (!m_webViewImpl->page()->focusController().isFocused())
564 m_webViewImpl->setFocus(true);
565
562 m_generatingEvent = true; 566 m_generatingEvent = true;
563 WebKeyboardEvent webEvent = WebKeyboardEventBuilder(event); 567 WebKeyboardEvent webEvent = WebKeyboardEventBuilder(event);
564 if (!webEvent.keyIdentifier[0] && webEvent.type != WebInputEvent::Char) 568 if (!webEvent.keyIdentifier[0] && webEvent.type != WebInputEvent::Char)
565 webEvent.setKeyIdentifierFromWindowsKeyCode(); 569 webEvent.setKeyIdentifierFromWindowsKeyCode();
566 m_webViewImpl->handleInputEvent(webEvent); 570 m_webViewImpl->handleInputEvent(webEvent);
567 m_generatingEvent = false; 571 m_generatingEvent = false;
568 } 572 }
569 573
570 void WebDevToolsAgentImpl::dispatchMouseEvent(const PlatformMouseEvent& event) 574 void WebDevToolsAgentImpl::dispatchMouseEvent(const PlatformMouseEvent& event)
571 { 575 {
576 if (!m_webViewImpl->page()->focusController().isFocused())
577 m_webViewImpl->setFocus(true);
578
572 m_generatingEvent = true; 579 m_generatingEvent = true;
573 WebMouseEvent webEvent = WebMouseEventBuilder(m_webViewImpl->mainFrameImpl() ->frameView(), event); 580 WebMouseEvent webEvent = WebMouseEventBuilder(m_webViewImpl->mainFrameImpl() ->frameView(), event);
574 m_webViewImpl->handleInputEvent(webEvent); 581 m_webViewImpl->handleInputEvent(webEvent);
575 m_generatingEvent = false; 582 m_generatingEvent = false;
576 } 583 }
577 584
578 void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message) 585 void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message)
579 { 586 {
580 inspectorController()->dispatchMessageFromFrontend(message); 587 inspectorController()->dispatchMessageFromFrontend(message);
581 } 588 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) 707 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd)
701 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); 708 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd);
702 } 709 }
703 710
704 void WebDevToolsAgent::processPendingMessages() 711 void WebDevToolsAgent::processPendingMessages()
705 { 712 {
706 PageScriptDebugServer::shared().runPendingTasks(); 713 PageScriptDebugServer::shared().runPendingTasks();
707 } 714 }
708 715
709 } // namespace blink 716 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698