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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 | 480 |
481 MainThreadDebugger* mainThreadDebugger = MainThreadDebugger::instance(); | 481 MainThreadDebugger* mainThreadDebugger = MainThreadDebugger::instance(); |
482 m_injectedScriptManager->injectedScriptHost()->init( | 482 m_injectedScriptManager->injectedScriptHost()->init( |
483 m_pageConsoleAgent.get(), | 483 m_pageConsoleAgent.get(), |
484 debuggerAgent->v8DebuggerAgent(), | 484 debuggerAgent->v8DebuggerAgent(), |
485 bind<PassRefPtr<TypeBuilder::Runtime::RemoteObject>, PassRefPtr<JSONObje
ct>>(&InspectorInspectorAgent::inspect, m_inspectorAgent.get()), | 485 bind<PassRefPtr<TypeBuilder::Runtime::RemoteObject>, PassRefPtr<JSONObje
ct>>(&InspectorInspectorAgent::inspect, m_inspectorAgent.get()), |
486 mainThreadDebugger->debugger(), | 486 mainThreadDebugger->debugger(), |
487 adoptPtr(new PageInjectedScriptHostClient())); | 487 adoptPtr(new PageInjectedScriptHostClient())); |
488 | 488 |
489 if (m_overlay) | 489 if (m_overlay) |
490 m_overlay->init(m_cssAgent.get(), debuggerAgent); | 490 m_overlay->init(m_cssAgent.get(), debuggerAgent, m_domAgent.get()); |
491 } | 491 } |
492 | 492 |
493 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent>
agent) | 493 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent>
agent) |
494 { | 494 { |
495 m_agents.append(agent); | 495 m_agents.append(agent); |
496 } | 496 } |
497 | 497 |
498 void WebDevToolsAgentImpl::attach(const WebString& hostId) | 498 void WebDevToolsAgentImpl::attach(const WebString& hostId) |
499 { | 499 { |
500 if (m_attached) | 500 if (m_attached) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgent
s.get()); | 553 InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgent
s.get()); |
554 | 554 |
555 m_attached = false; | 555 m_attached = false; |
556 } | 556 } |
557 | 557 |
558 void WebDevToolsAgentImpl::continueProgram() | 558 void WebDevToolsAgentImpl::continueProgram() |
559 { | 559 { |
560 ClientMessageLoopAdapter::continueProgram(); | 560 ClientMessageLoopAdapter::continueProgram(); |
561 } | 561 } |
562 | 562 |
563 bool WebDevToolsAgentImpl::handleInputEvent(const WebInputEvent& inputEvent) | |
564 { | |
565 if (!m_attached) | |
566 return false; | |
567 | |
568 if (WebInputEvent::isGestureEventType(inputEvent.type) && inputEvent.type ==
WebInputEvent::GestureTap) { | |
569 // Only let GestureTab in (we only need it and we know PlatformGestureEv
entBuilder supports it). | |
570 PlatformGestureEvent gestureEvent = PlatformGestureEventBuilder(m_webLoc
alFrameImpl->frameView(), static_cast<const WebGestureEvent&>(inputEvent)); | |
571 return handleGestureEvent(m_webLocalFrameImpl->frame(), gestureEvent); | |
572 } | |
573 if (WebInputEvent::isMouseEventType(inputEvent.type) && inputEvent.type != W
ebInputEvent::MouseEnter) { | |
574 // PlatformMouseEventBuilder does not work with MouseEnter type, so we f
ilter it out manually. | |
575 PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder(m_webLocalFram
eImpl->frameView(), static_cast<const WebMouseEvent&>(inputEvent)); | |
576 return handleMouseEvent(m_webLocalFrameImpl->frame(), mouseEvent); | |
577 } | |
578 if (WebInputEvent::isTouchEventType(inputEvent.type)) { | |
579 PlatformTouchEvent touchEvent = PlatformTouchEventBuilder(m_webLocalFram
eImpl->frameView(), static_cast<const WebTouchEvent&>(inputEvent)); | |
580 return handleTouchEvent(m_webLocalFrameImpl->frame(), touchEvent); | |
581 } | |
582 return false; | |
583 } | |
584 | |
585 bool WebDevToolsAgentImpl::handleGestureEvent(LocalFrame* frame, const PlatformG
estureEvent& event) | |
586 { | |
587 if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent()
) | |
588 return domAgent->handleGestureEvent(frame, event); | |
589 return false; | |
590 } | |
591 | |
592 bool WebDevToolsAgentImpl::handleMouseEvent(LocalFrame* frame, const PlatformMou
seEvent& event) | |
593 { | |
594 if (event.type() == PlatformEvent::MouseMoved) { | |
595 if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAge
nt()) | |
596 return domAgent->handleMouseMove(frame, event); | |
597 return false; | |
598 } | |
599 if (event.type() == PlatformEvent::MousePressed) { | |
600 if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAge
nt()) | |
601 return domAgent->handleMousePress(); | |
602 } | |
603 return false; | |
604 } | |
605 | |
606 bool WebDevToolsAgentImpl::handleTouchEvent(LocalFrame* frame, const PlatformTou
chEvent& event) | |
607 { | |
608 if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent()
) | |
609 return domAgent->handleTouchEvent(frame, event); | |
610 return false; | |
611 } | |
612 | |
613 void WebDevToolsAgentImpl::didCommitLoadForLocalFrame(LocalFrame* frame) | 563 void WebDevToolsAgentImpl::didCommitLoadForLocalFrame(LocalFrame* frame) |
614 { | 564 { |
615 m_resourceContentLoader->didCommitLoadForLocalFrame(frame); | 565 m_resourceContentLoader->didCommitLoadForLocalFrame(frame); |
616 m_agents.didCommitLoadForLocalFrame(frame); | 566 m_agents.didCommitLoadForLocalFrame(frame); |
617 } | 567 } |
618 | 568 |
619 bool WebDevToolsAgentImpl::screencastEnabled() | 569 bool WebDevToolsAgentImpl::screencastEnabled() |
620 { | 570 { |
621 return m_pageAgent->screencastEnabled(); | 571 return m_pageAgent->screencastEnabled(); |
622 } | 572 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) | 708 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) |
759 return false; | 709 return false; |
760 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) | 710 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) |
761 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) | 711 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) |
762 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) | 712 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) |
763 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 713 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
764 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 714 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
765 } | 715 } |
766 | 716 |
767 } // namespace blink | 717 } // namespace blink |
OLD | NEW |