| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 230 |
| 231 bool InspectorOverlay::handleInputEvent(const WebInputEvent& inputEvent) { | 231 bool InspectorOverlay::handleInputEvent(const WebInputEvent& inputEvent) { |
| 232 bool handled = false; | 232 bool handled = false; |
| 233 | 233 |
| 234 if (isEmpty()) | 234 if (isEmpty()) |
| 235 return false; | 235 return false; |
| 236 | 236 |
| 237 if (WebInputEvent::isGestureEventType(inputEvent.type) && | 237 if (WebInputEvent::isGestureEventType(inputEvent.type) && |
| 238 inputEvent.type == WebInputEvent::GestureTap) { | 238 inputEvent.type == WebInputEvent::GestureTap) { |
| 239 // We only have a use for gesture tap. | 239 // We only have a use for gesture tap. |
| 240 WebGestureEvent scaledEvent = TransformWebGestureEvent( | 240 WebGestureEvent transformedEvent = TransformWebGestureEvent( |
| 241 m_frameImpl->frameView(), | 241 m_frameImpl->frameView(), |
| 242 static_cast<const WebGestureEvent&>(inputEvent)); | 242 static_cast<const WebGestureEvent&>(inputEvent)); |
| 243 handled = handleGestureEvent(scaledEvent); | 243 handled = handleGestureEvent(transformedEvent); |
| 244 if (handled) | 244 if (handled) |
| 245 return true; | 245 return true; |
| 246 | 246 |
| 247 overlayMainFrame()->eventHandler().handleGestureEvent(scaledEvent); | 247 overlayMainFrame()->eventHandler().handleGestureEvent(transformedEvent); |
| 248 } | 248 } |
| 249 if (WebInputEvent::isMouseEventType(inputEvent.type) && | 249 if (WebInputEvent::isMouseEventType(inputEvent.type) && |
| 250 inputEvent.type != WebInputEvent::MouseEnter) { | 250 inputEvent.type != WebInputEvent::MouseEnter) { |
| 251 // PlatformMouseEventBuilder does not work with MouseEnter type, so we | 251 // PlatformMouseEventBuilder does not work with MouseEnter type, so we |
| 252 // filter it out manually. | 252 // filter it out manually. |
| 253 PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder( | 253 PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder( |
| 254 m_frameImpl->frameView(), | 254 m_frameImpl->frameView(), |
| 255 static_cast<const WebMouseEvent&>(inputEvent)); | 255 static_cast<const WebMouseEvent&>(inputEvent)); |
| 256 | 256 |
| 257 if (mouseEvent.type() == PlatformEvent::MouseMoved) | 257 if (mouseEvent.type() == PlatformEvent::MouseMoved) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 288 touchEvent, | 288 touchEvent, |
| 289 createPlatformTouchEventVector(m_frameImpl->frameView(), | 289 createPlatformTouchEventVector(m_frameImpl->frameView(), |
| 290 std::vector<const WebInputEvent*>())); | 290 std::vector<const WebInputEvent*>())); |
| 291 } | 291 } |
| 292 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) { | 292 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) { |
| 293 overlayMainFrame()->eventHandler().keyEvent( | 293 overlayMainFrame()->eventHandler().keyEvent( |
| 294 static_cast<const WebKeyboardEvent&>(inputEvent)); | 294 static_cast<const WebKeyboardEvent&>(inputEvent)); |
| 295 } | 295 } |
| 296 | 296 |
| 297 if (inputEvent.type == WebInputEvent::MouseWheel) { | 297 if (inputEvent.type == WebInputEvent::MouseWheel) { |
| 298 PlatformWheelEvent wheelEvent = PlatformWheelEventBuilder( | 298 WebMouseWheelEvent transformedEvent = TransformWebMouseWheelEvent( |
| 299 m_frameImpl->frameView(), | 299 m_frameImpl->frameView(), |
| 300 static_cast<const WebMouseWheelEvent&>(inputEvent)); | 300 static_cast<const WebMouseWheelEvent&>(inputEvent)); |
| 301 handled = overlayMainFrame()->eventHandler().handleWheelEvent(wheelEvent) != | 301 handled = overlayMainFrame()->eventHandler().handleWheelEvent( |
| 302 WebInputEventResult::NotHandled; | 302 transformedEvent) != WebInputEventResult::NotHandled; |
| 303 } | 303 } |
| 304 | 304 |
| 305 return handled; | 305 return handled; |
| 306 } | 306 } |
| 307 | 307 |
| 308 void InspectorOverlay::setPausedInDebuggerMessage(const String& message) { | 308 void InspectorOverlay::setPausedInDebuggerMessage(const String& message) { |
| 309 m_pausedInDebuggerMessage = message; | 309 m_pausedInDebuggerMessage = message; |
| 310 scheduleUpdate(); | 310 scheduleUpdate(); |
| 311 } | 311 } |
| 312 | 312 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 bool InspectorOverlay::shouldSearchForNode() { | 785 bool InspectorOverlay::shouldSearchForNode() { |
| 786 return m_inspectMode != InspectorDOMAgent::NotSearching; | 786 return m_inspectMode != InspectorDOMAgent::NotSearching; |
| 787 } | 787 } |
| 788 | 788 |
| 789 void InspectorOverlay::inspect(Node* node) { | 789 void InspectorOverlay::inspect(Node* node) { |
| 790 if (m_domAgent) | 790 if (m_domAgent) |
| 791 m_domAgent->inspect(node); | 791 m_domAgent->inspect(node); |
| 792 } | 792 } |
| 793 | 793 |
| 794 } // namespace blink | 794 } // namespace blink |
| OLD | NEW |