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

Side by Side Diff: third_party/WebKit/Source/web/InspectorOverlay.cpp

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return; 226 return;
227 227
228 AutoReset<bool> scoped(&m_inLayout, true); 228 AutoReset<bool> scoped(&m_inLayout, true);
229 if (m_needsUpdate) { 229 if (m_needsUpdate) {
230 m_needsUpdate = false; 230 m_needsUpdate = false;
231 rebuildOverlayPage(); 231 rebuildOverlayPage();
232 } 232 }
233 overlayMainFrame()->view()->updateAllLifecyclePhases(); 233 overlayMainFrame()->view()->updateAllLifecyclePhases();
234 } 234 }
235 235
236 bool InspectorOverlay::handleInputEvent(const WebInputEvent& inputEvent) { 236 bool InspectorOverlay::handleInputEvent(
237 const CoalescedWebInputEvent& coalescedEvent) {
237 bool handled = false; 238 bool handled = false;
239 const WebInputEvent& inputEvent = coalescedEvent.event();
238 240
239 if (isEmpty()) 241 if (isEmpty())
240 return false; 242 return false;
241 243
242 if (WebInputEvent::isGestureEventType(inputEvent.type) && 244 if (WebInputEvent::isGestureEventType(inputEvent.type) &&
243 inputEvent.type == WebInputEvent::GestureTap) { 245 inputEvent.type == WebInputEvent::GestureTap) {
244 // Only let GestureTab in (we only need it and we know 246 // Only let GestureTab in (we only need it and we know
245 // PlatformGestureEventBuilder supports it). 247 // PlatformGestureEventBuilder supports it).
246 PlatformGestureEvent gestureEvent = PlatformGestureEventBuilder( 248 PlatformGestureEvent gestureEvent = PlatformGestureEventBuilder(
247 m_frameImpl->frameView(), 249 m_frameImpl->frameView(),
(...skipping 13 matching lines...) Expand all
261 static_cast<const WebMouseEvent&>(inputEvent)); 263 static_cast<const WebMouseEvent&>(inputEvent));
262 264
263 if (mouseEvent.type() == PlatformEvent::MouseMoved) 265 if (mouseEvent.type() == PlatformEvent::MouseMoved)
264 handled = handleMouseMove(mouseEvent); 266 handled = handleMouseMove(mouseEvent);
265 else if (mouseEvent.type() == PlatformEvent::MousePressed) 267 else if (mouseEvent.type() == PlatformEvent::MousePressed)
266 handled = handleMousePress(); 268 handled = handleMousePress();
267 269
268 if (handled) 270 if (handled)
269 return true; 271 return true;
270 272
271 if (mouseEvent.type() == PlatformEvent::MouseMoved) 273 if (mouseEvent.type() == PlatformEvent::MouseMoved) {
272 handled = overlayMainFrame()->eventHandler().handleMouseMoveEvent( 274 handled =
273 mouseEvent) != WebInputEventResult::NotHandled; 275 overlayMainFrame()->eventHandler().handleMouseMoveEvent(
274 if (mouseEvent.type() == PlatformEvent::MousePressed) 276 mouseEvent, createPlatformMouseEventVector(
277 m_frameImpl->frameView(),
278 coalescedEvent.getCoalescedEventsPointers())) !=
279 WebInputEventResult::NotHandled;
280 }
281 if (mouseEvent.type() == PlatformEvent::MousePressed) {
275 handled = overlayMainFrame()->eventHandler().handleMousePressEvent( 282 handled = overlayMainFrame()->eventHandler().handleMousePressEvent(
276 mouseEvent) != WebInputEventResult::NotHandled; 283 mouseEvent) != WebInputEventResult::NotHandled;
277 if (mouseEvent.type() == PlatformEvent::MouseReleased) 284 }
285 if (mouseEvent.type() == PlatformEvent::MouseReleased) {
278 handled = overlayMainFrame()->eventHandler().handleMouseReleaseEvent( 286 handled = overlayMainFrame()->eventHandler().handleMouseReleaseEvent(
279 mouseEvent) != WebInputEventResult::NotHandled; 287 mouseEvent) != WebInputEventResult::NotHandled;
288 }
280 } 289 }
281 290
282 if (WebInputEvent::isTouchEventType(inputEvent.type)) { 291 if (WebInputEvent::isTouchEventType(inputEvent.type)) {
283 PlatformTouchEvent touchEvent = PlatformTouchEventBuilder( 292 PlatformTouchEvent touchEvent = PlatformTouchEventBuilder(
284 m_frameImpl->frameView(), 293 m_frameImpl->frameView(),
285 static_cast<const WebTouchEvent&>(inputEvent)); 294 static_cast<const WebTouchEvent&>(inputEvent));
286 handled = handleTouchEvent(touchEvent); 295 handled = handleTouchEvent(touchEvent);
287 if (handled) 296 if (handled)
288 return true; 297 return true;
289 overlayMainFrame()->eventHandler().handleTouchEvent(touchEvent); 298 overlayMainFrame()->eventHandler().handleTouchEvent(
299 touchEvent, createPlatformTouchEventVector(
300 m_frameImpl->frameView(),
301 coalescedEvent.getCoalescedEventsPointers()));
290 } 302 }
291 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) { 303 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) {
292 overlayMainFrame()->eventHandler().keyEvent( 304 overlayMainFrame()->eventHandler().keyEvent(
293 static_cast<const WebKeyboardEvent&>(inputEvent)); 305 static_cast<const WebKeyboardEvent&>(inputEvent));
294 } 306 }
295 307
296 if (inputEvent.type == WebInputEvent::MouseWheel) { 308 if (inputEvent.type == WebInputEvent::MouseWheel) {
297 PlatformWheelEvent wheelEvent = PlatformWheelEventBuilder( 309 PlatformWheelEvent wheelEvent = PlatformWheelEventBuilder(
298 m_frameImpl->frameView(), 310 m_frameImpl->frameView(),
299 static_cast<const WebMouseWheelEvent&>(inputEvent)); 311 static_cast<const WebMouseWheelEvent&>(inputEvent));
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 !node->isElementNode() || !node->ownerDocument()->isActive() || 879 !node->isElementNode() || !node->ownerDocument()->isActive() ||
868 !m_cssAgent || !m_domAgent) 880 !m_cssAgent || !m_domAgent)
869 return; 881 return;
870 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgent, 882 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgent,
871 &overlayMainFrame()->script()); 883 &overlayMainFrame()->script());
872 toChromeClientImpl(m_frameImpl->frame()->host()->chromeClient()) 884 toChromeClientImpl(m_frameImpl->frame()->host()->chromeClient())
873 .setCursorOverridden(true); 885 .setCursorOverridden(true);
874 } 886 }
875 887
876 } // namespace blink 888 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698