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

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

Issue 1864523004: Add UMA metric for tracking root level listeners for blocking touch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 30 matching lines...) Expand all
41 ~TouchEvent() override; 41 ~TouchEvent() override;
42 42
43 // We only initialize sourceCapabilities when we create TouchEvent from Even tHandler, null if it is from JavaScript. 43 // We only initialize sourceCapabilities when we create TouchEvent from Even tHandler, null if it is from JavaScript.
44 static TouchEvent* create() 44 static TouchEvent* create()
45 { 45 {
46 return new TouchEvent; 46 return new TouchEvent;
47 } 47 }
48 static TouchEvent* create(TouchList* touches, 48 static TouchEvent* create(TouchList* touches,
49 TouchList* targetTouches, TouchList* changedTouches, 49 TouchList* targetTouches, TouchList* changedTouches,
50 const AtomicString& type, AbstractView* view, 50 const AtomicString& type, AbstractView* view,
51 PlatformEvent::Modifiers modifiers, bool cancelable, bool causesScrollin gIfUncanceled, 51 PlatformEvent::Modifiers modifiers, bool cancelable,
52 bool causesScrollingIfUncanceled, bool firstTouchMoveAfterTouchStart,
tdresser 2016/04/07 12:22:08 firstTouchMoveAfterScrollStart is a bit confusing,
dtapuska 2016/04/19 17:54:47 Removed
52 double platformTimeStamp) 53 double platformTimeStamp)
53 { 54 {
54 return new TouchEvent(touches, targetTouches, changedTouches, type, view , 55 return new TouchEvent(touches, targetTouches, changedTouches,
55 modifiers, cancelable, causesScrollingIfUncanceled, platformTimeStam p); 56 type, view, modifiers, cancelable,
57 causesScrollingIfUncanceled,
58 firstTouchMoveAfterTouchStart, platformTimeStamp);
56 } 59 }
57 60
58 static TouchEvent* create(const AtomicString& type, const TouchEventInit& in itializer) 61 static TouchEvent* create(const AtomicString& type, const TouchEventInit& in itializer)
59 { 62 {
60 return new TouchEvent(type, initializer); 63 return new TouchEvent(type, initializer);
61 } 64 }
62 65
63 void initTouchEvent(ScriptState*, TouchList* touches, TouchList* targetTouch es, 66 void initTouchEvent(ScriptState*, TouchList* touches, TouchList* targetTouch es,
64 TouchList* changedTouches, const AtomicString& type, 67 TouchList* changedTouches, const AtomicString& type,
65 AbstractView*, 68 AbstractView*,
66 int, int, int, int, // unused useless members of web exposed API 69 int, int, int, int, // unused useless members of web exposed API
67 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 70 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
68 71
69 TouchList* touches() const { return m_touches.get(); } 72 TouchList* touches() const { return m_touches.get(); }
70 TouchList* targetTouches() const { return m_targetTouches.get(); } 73 TouchList* targetTouches() const { return m_targetTouches.get(); }
71 TouchList* changedTouches() const { return m_changedTouches.get(); } 74 TouchList* changedTouches() const { return m_changedTouches.get(); }
72 75
73 void setTouches(TouchList* touches) { m_touches = touches; } 76 void setTouches(TouchList* touches) { m_touches = touches; }
74 void setTargetTouches(TouchList* targetTouches) { m_targetTouches = targetTo uches; } 77 void setTargetTouches(TouchList* targetTouches) { m_targetTouches = targetTo uches; }
75 void setChangedTouches(TouchList* changedTouches) { m_changedTouches = chang edTouches; } 78 void setChangedTouches(TouchList* changedTouches) { m_changedTouches = chang edTouches; }
76 79
77 bool causesScrollingIfUncanceled() const { return m_causesScrollingIfUncance led; } 80 bool causesScrollingIfUncanceled() const { return m_causesScrollingIfUncance led; }
78 81
82 bool firstTouchMoveAfterTouchStart() const { return m_firstTouchMoveAfterTou chStart; }
79 bool isTouchEvent() const override; 83 bool isTouchEvent() const override;
80 84
81 const AtomicString& interfaceName() const override; 85 const AtomicString& interfaceName() const override;
82 86
83 void preventDefault() override; 87 void preventDefault() override;
84 88
85 EventDispatchMediator* createMediator() override; 89 EventDispatchMediator* createMediator() override;
86 90
87 DECLARE_VIRTUAL_TRACE(); 91 DECLARE_VIRTUAL_TRACE();
88 92
89 private: 93 private:
90 TouchEvent(); 94 TouchEvent();
91 TouchEvent(TouchList* touches, TouchList* targetTouches, 95 TouchEvent(TouchList* touches, TouchList* targetTouches,
92 TouchList* changedTouches, const AtomicString& type, 96 TouchList* changedTouches, const AtomicString& type,
93 AbstractView*, PlatformEvent::Modifiers, 97 AbstractView*, PlatformEvent::Modifiers,
94 bool cancelable, bool causesScrollingIfUncanceled, 98 bool cancelable, bool causesScrollingIfUncanceled,
95 double platformTimeStamp); 99 bool firstTouchMoveAfterTouchStart, double platformTimeStamp);
96 TouchEvent(const AtomicString&, const TouchEventInit&); 100 TouchEvent(const AtomicString&, const TouchEventInit&);
97 101
98 Member<TouchList> m_touches; 102 Member<TouchList> m_touches;
99 Member<TouchList> m_targetTouches; 103 Member<TouchList> m_targetTouches;
100 Member<TouchList> m_changedTouches; 104 Member<TouchList> m_changedTouches;
101 bool m_causesScrollingIfUncanceled; 105 bool m_causesScrollingIfUncanceled;
106 bool m_firstTouchMoveAfterTouchStart;
102 }; 107 };
103 108
104 class TouchEventDispatchMediator final : public EventDispatchMediator { 109 class TouchEventDispatchMediator final : public EventDispatchMediator {
105 public: 110 public:
106 static TouchEventDispatchMediator* create(TouchEvent*); 111 static TouchEventDispatchMediator* create(TouchEvent*);
107 112
108 private: 113 private:
109 explicit TouchEventDispatchMediator(TouchEvent*); 114 explicit TouchEventDispatchMediator(TouchEvent*);
110 TouchEvent& event() const; 115 TouchEvent& event() const;
111 DispatchEventResult dispatchEvent(EventDispatcher&) const override; 116 DispatchEventResult dispatchEvent(EventDispatcher&) const override;
112 }; 117 };
113 118
114 DEFINE_EVENT_TYPE_CASTS(TouchEvent); 119 DEFINE_EVENT_TYPE_CASTS(TouchEvent);
115 120
116 } // namespace blink 121 } // namespace blink
117 122
118 #endif // TouchEvent_h 123 #endif // TouchEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698