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

Side by Side Diff: third_party/WebKit/Source/core/events/TouchEvent.cpp

Issue 2687903002: Track constant InputDeviceCapabilities objects per-window. (Closed)
Patch Set: Created 3 years, 10 months 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 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 copyright 10 * * Redistributions in binary form must reproduce the above copyright
(...skipping 15 matching lines...) Expand all
26 26
27 #include "core/events/TouchEvent.h" 27 #include "core/events/TouchEvent.h"
28 28
29 #include "bindings/core/v8/DOMWrapperWorld.h" 29 #include "bindings/core/v8/DOMWrapperWorld.h"
30 #include "bindings/core/v8/ScriptState.h" 30 #include "bindings/core/v8/ScriptState.h"
31 #include "core/events/EventDispatcher.h" 31 #include "core/events/EventDispatcher.h"
32 #include "core/frame/FrameConsole.h" 32 #include "core/frame/FrameConsole.h"
33 #include "core/frame/FrameView.h" 33 #include "core/frame/FrameView.h"
34 #include "core/frame/LocalDOMWindow.h" 34 #include "core/frame/LocalDOMWindow.h"
35 #include "core/html/HTMLElement.h" 35 #include "core/html/HTMLElement.h"
36 #include "core/input/InputDeviceCapabilities.h"
36 #include "core/inspector/ConsoleMessage.h" 37 #include "core/inspector/ConsoleMessage.h"
37 #include "platform/Histogram.h" 38 #include "platform/Histogram.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 namespace { 42 namespace {
42 43
43 // These offsets change indicies into the ListenerHistogram 44 // These offsets change indicies into the ListenerHistogram
44 // enumeration. The addition of a series of offsets then 45 // enumeration. The addition of a series of offsets then
45 // produces the resulting ListenerHistogram value. 46 // produces the resulting ListenerHistogram value.
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // creating this touchevent, which is always created from input device 219 // creating this touchevent, which is always created from input device
219 // capabilities from EventHandler. 220 // capabilities from EventHandler.
220 : UIEventWithKeyState( 221 : UIEventWithKeyState(
221 type, 222 type,
222 true, 223 true,
223 cancelable, 224 cancelable,
224 view, 225 view,
225 0, 226 0,
226 modifiers, 227 modifiers,
227 platformTimeStamp, 228 platformTimeStamp,
228 InputDeviceCapabilities::firesTouchEventsSourceCapabilities()), 229 view ? view->getInputDeviceCapabilities()->firesTouchEvents(true)
230 : nullptr),
229 m_touches(touches), 231 m_touches(touches),
230 m_targetTouches(targetTouches), 232 m_targetTouches(targetTouches),
231 m_changedTouches(changedTouches), 233 m_changedTouches(changedTouches),
232 m_causesScrollingIfUncanceled(causesScrollingIfUncanceled), 234 m_causesScrollingIfUncanceled(causesScrollingIfUncanceled),
233 m_firstTouchMoveOrStart(firstTouchMoveOrStart), 235 m_firstTouchMoveOrStart(firstTouchMoveOrStart),
234 m_defaultPreventedBeforeCurrentTarget(false), 236 m_defaultPreventedBeforeCurrentTarget(false),
235 m_currentTouchAction(currentTouchAction), 237 m_currentTouchAction(currentTouchAction),
236 m_pointerType(pointerType) {} 238 m_pointerType(pointerType) {}
237 239
238 TouchEvent::TouchEvent(const AtomicString& type, 240 TouchEvent::TouchEvent(const AtomicString& type,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 return toTouchEvent(EventDispatchMediator::event()); 354 return toTouchEvent(EventDispatchMediator::event());
353 } 355 }
354 356
355 DispatchEventResult TouchEventDispatchMediator::dispatchEvent( 357 DispatchEventResult TouchEventDispatchMediator::dispatchEvent(
356 EventDispatcher& dispatcher) const { 358 EventDispatcher& dispatcher) const {
357 event().eventPath().adjustForTouchEvent(event()); 359 event().eventPath().adjustForTouchEvent(event());
358 return dispatcher.dispatch(); 360 return dispatcher.dispatch();
359 } 361 }
360 362
361 } // namespace blink 363 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/MouseEvent.cpp ('k') | third_party/WebKit/Source/core/events/UIEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698