| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 void WebDevToolsAgentImpl::webViewResized(const WebSize& size) | 457 void WebDevToolsAgentImpl::webViewResized(const WebSize& size) |
| 458 { | 458 { |
| 459 if (m_metricsSupport) | 459 if (m_metricsSupport) |
| 460 m_metricsSupport->webViewResized(); | 460 m_metricsSupport->webViewResized(); |
| 461 if (InspectorController* ic = inspectorController()) | 461 if (InspectorController* ic = inspectorController()) |
| 462 ic->webViewResized(m_metricsSupport ? IntSize(size.width, size.height) :
IntSize()); | 462 ic->webViewResized(m_metricsSupport ? IntSize(size.width, size.height) :
IntSize()); |
| 463 } | 463 } |
| 464 | 464 |
| 465 bool WebDevToolsAgentImpl::handleInputEvent(WebCore::Page* page, const WebInputE
vent& inputEvent) | 465 bool WebDevToolsAgentImpl::handleInputEvent(WebCore::Page* page, const WebInputE
vent& inputEvent) |
| 466 { | 466 { |
| 467 if (!m_attached) |
| 468 return false; |
| 469 |
| 467 InspectorController* ic = inspectorController(); | 470 InspectorController* ic = inspectorController(); |
| 468 if (!ic) | 471 if (!ic) |
| 469 return false; | 472 return false; |
| 470 | 473 |
| 474 if (WebInputEvent::isGestureEventType(inputEvent.type) && inputEvent.type ==
WebInputEvent::GestureTap) { |
| 475 // Only let GestureTab in (we only need it and we know PlatformGestureEv
entBuilder supports it). |
| 476 PlatformGestureEvent gestureEvent = PlatformGestureEventBuilder(page->ma
inFrame()->view(), *static_cast<const WebGestureEvent*>(&inputEvent)); |
| 477 return ic->handleGestureEvent(page->mainFrame(), gestureEvent); |
| 478 } |
| 471 if (WebInputEvent::isMouseEventType(inputEvent.type) && inputEvent.type != W
ebInputEvent::MouseEnter) { | 479 if (WebInputEvent::isMouseEventType(inputEvent.type) && inputEvent.type != W
ebInputEvent::MouseEnter) { |
| 472 // PlatformMouseEventBuilder does not work with MouseEnter type, so we f
ilter it out manually. | 480 // PlatformMouseEventBuilder does not work with MouseEnter type, so we f
ilter it out manually. |
| 473 PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder(page->mainFram
e()->view(), *static_cast<const WebMouseEvent*>(&inputEvent)); | 481 PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder(page->mainFram
e()->view(), *static_cast<const WebMouseEvent*>(&inputEvent)); |
| 474 return ic->handleMouseEvent(page->mainFrame(), mouseEvent); | 482 return ic->handleMouseEvent(page->mainFrame(), mouseEvent); |
| 475 } | 483 } |
| 476 if (WebInputEvent::isTouchEventType(inputEvent.type)) { | 484 if (WebInputEvent::isTouchEventType(inputEvent.type)) { |
| 477 PlatformTouchEvent touchEvent = PlatformTouchEventBuilder(page->mainFram
e()->view(), *static_cast<const WebTouchEvent*>(&inputEvent)); | 485 PlatformTouchEvent touchEvent = PlatformTouchEventBuilder(page->mainFram
e()->view(), *static_cast<const WebTouchEvent*>(&inputEvent)); |
| 478 return ic->handleTouchEvent(page->mainFrame(), touchEvent); | 486 return ic->handleTouchEvent(page->mainFrame(), touchEvent); |
| 479 } | 487 } |
| 480 return false; | 488 return false; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack
endDispatcher::kProfiler_getCPUProfileCmd] | 759 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack
endDispatcher::kProfiler_getCPUProfileCmd] |
| 752 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack
endDispatcher::kHeapProfiler_getHeapSnapshotCmd]; | 760 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack
endDispatcher::kHeapProfiler_getHeapSnapshotCmd]; |
| 753 } | 761 } |
| 754 | 762 |
| 755 void WebDevToolsAgent::processPendingMessages() | 763 void WebDevToolsAgent::processPendingMessages() |
| 756 { | 764 { |
| 757 PageScriptDebugServer::shared().runPendingTasks(); | 765 PageScriptDebugServer::shared().runPendingTasks(); |
| 758 } | 766 } |
| 759 | 767 |
| 760 } // namespace WebKit | 768 } // namespace WebKit |
| OLD | NEW |