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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 if (WebInputEvent::isMouseEventType(inputEvent.type) && inputEvent.type != W
ebInputEvent::MouseEnter) { | 349 if (WebInputEvent::isMouseEventType(inputEvent.type) && inputEvent.type != W
ebInputEvent::MouseEnter) { |
350 // PlatformMouseEventBuilder does not work with MouseEnter type, so we f
ilter it out manually. | 350 // PlatformMouseEventBuilder does not work with MouseEnter type, so we f
ilter it out manually. |
351 PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder(page->deprecat
edLocalMainFrame()->view(), static_cast<const WebMouseEvent&>(inputEvent)); | 351 PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder(page->deprecat
edLocalMainFrame()->view(), static_cast<const WebMouseEvent&>(inputEvent)); |
352 return ic->handleMouseEvent(toLocalFrame(page->mainFrame()), mouseEvent)
; | 352 return ic->handleMouseEvent(toLocalFrame(page->mainFrame()), mouseEvent)
; |
353 } | 353 } |
354 if (WebInputEvent::isTouchEventType(inputEvent.type)) { | 354 if (WebInputEvent::isTouchEventType(inputEvent.type)) { |
355 PlatformTouchEvent touchEvent = PlatformTouchEventBuilder(page->deprecat
edLocalMainFrame()->view(), static_cast<const WebTouchEvent&>(inputEvent)); | 355 PlatformTouchEvent touchEvent = PlatformTouchEventBuilder(page->deprecat
edLocalMainFrame()->view(), static_cast<const WebTouchEvent&>(inputEvent)); |
356 return ic->handleTouchEvent(toLocalFrame(page->mainFrame()), touchEvent)
; | 356 return ic->handleTouchEvent(toLocalFrame(page->mainFrame()), touchEvent)
; |
357 } | 357 } |
358 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) { | 358 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) { |
359 PlatformKeyboardEvent keyboardEvent = PlatformKeyboardEventBuilder(stati
c_cast<const WebKeyboardEvent&>(inputEvent)); | 359 PlatformKeyboardEvent keyboardEvent = PlatformKeyboardEventBuilder(page-
>deprecatedLocalMainFrame()->view(), static_cast<const WebKeyboardEvent&>(inputE
vent)); |
360 return ic->handleKeyboardEvent(page->deprecatedLocalMainFrame(), keyboar
dEvent); | 360 return ic->handleKeyboardEvent(page->deprecatedLocalMainFrame(), keyboar
dEvent); |
361 } | 361 } |
362 return false; | 362 return false; |
363 } | 363 } |
364 | 364 |
365 void WebDevToolsAgentImpl::didLayout() | 365 void WebDevToolsAgentImpl::didLayout() |
366 { | 366 { |
367 m_webViewDidLayoutOnceAfterLoad = true; | 367 m_webViewDidLayoutOnceAfterLoad = true; |
368 } | 368 } |
369 | 369 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 if (InspectorController* ic = inspectorController()) | 495 if (InspectorController* ic = inspectorController()) |
496 ic->processGPUEvent(event.timestamp, event.phase, event.foreign, event.u
sedGPUMemoryBytes, event.limitGPUMemoryBytes); | 496 ic->processGPUEvent(event.timestamp, event.phase, event.foreign, event.u
sedGPUMemoryBytes, event.limitGPUMemoryBytes); |
497 } | 497 } |
498 | 498 |
499 void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event) | 499 void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event) |
500 { | 500 { |
501 if (!m_webViewImpl->page()->focusController().isFocused()) | 501 if (!m_webViewImpl->page()->focusController().isFocused()) |
502 m_webViewImpl->setFocus(true); | 502 m_webViewImpl->setFocus(true); |
503 | 503 |
504 m_generatingEvent = true; | 504 m_generatingEvent = true; |
505 WebKeyboardEvent webEvent = WebKeyboardEventBuilder(event); | 505 WebKeyboardEvent webEvent = WebKeyboardEventBuilder(m_webViewImpl->mainFrame
Impl()->frameView(), event); |
506 if (!webEvent.keyIdentifier[0] && webEvent.type != WebInputEvent::Char) | 506 if (!webEvent.keyIdentifier[0] && webEvent.type != WebInputEvent::Char) |
507 webEvent.setKeyIdentifierFromWindowsKeyCode(); | 507 webEvent.setKeyIdentifierFromWindowsKeyCode(); |
508 m_webViewImpl->handleInputEvent(webEvent); | 508 m_webViewImpl->handleInputEvent(webEvent); |
509 m_generatingEvent = false; | 509 m_generatingEvent = false; |
510 } | 510 } |
511 | 511 |
512 void WebDevToolsAgentImpl::dispatchMouseEvent(const PlatformMouseEvent& event) | 512 void WebDevToolsAgentImpl::dispatchMouseEvent(const PlatformMouseEvent& event) |
513 { | 513 { |
514 if (!m_webViewImpl->page()->focusController().isFocused()) | 514 if (!m_webViewImpl->page()->focusController().isFocused()) |
515 m_webViewImpl->setFocus(true); | 515 m_webViewImpl->setFocus(true); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 649 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
650 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 650 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
651 } | 651 } |
652 | 652 |
653 void WebDevToolsAgent::processPendingMessages() | 653 void WebDevToolsAgent::processPendingMessages() |
654 { | 654 { |
655 PageScriptDebugServer::shared().runPendingTasks(); | 655 PageScriptDebugServer::shared().runPendingTasks(); |
656 } | 656 } |
657 | 657 |
658 } // namespace blink | 658 } // namespace blink |
OLD | NEW |