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

Side by Side Diff: ui/events/event.h

Issue 469523003: Add the actual location coordinates to the touch cancel event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clone the state_point Created 6 years, 3 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/event_types.h" 10 #include "base/event_types.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 bool IsFlingScrollEvent() const { 181 bool IsFlingScrollEvent() const {
182 return type_ == ET_SCROLL_FLING_CANCEL || 182 return type_ == ET_SCROLL_FLING_CANCEL ||
183 type_ == ET_SCROLL_FLING_START; 183 type_ == ET_SCROLL_FLING_START;
184 } 184 }
185 185
186 bool IsMouseWheelEvent() const { 186 bool IsMouseWheelEvent() const {
187 return type_ == ET_MOUSEWHEEL; 187 return type_ == ET_MOUSEWHEEL;
188 } 188 }
189 189
190 bool IsLocatedEvent() const {
191 return IsMouseEvent() || IsScrollEvent() || IsTouchEvent() ||
192 IsGestureEvent();
193 }
194
190 // Convenience methods to cast |this| to a GestureEvent. IsGestureEvent() 195 // Convenience methods to cast |this| to a GestureEvent. IsGestureEvent()
191 // must be true as a precondition to calling these methods. 196 // must be true as a precondition to calling these methods.
192 GestureEvent* AsGestureEvent(); 197 GestureEvent* AsGestureEvent();
193 const GestureEvent* AsGestureEvent() const; 198 const GestureEvent* AsGestureEvent() const;
194 199
195 // Returns true if the event has a valid |native_event_|. 200 // Returns true if the event has a valid |native_event_|.
196 bool HasNativeEvent() const; 201 bool HasNativeEvent() const;
197 202
198 // Immediately stops the propagation of the event. This must be called only 203 // Immediately stops the propagation of the event. This must be called only
199 // from an EventHandler during an event-dispatch. Any event handler that may 204 // from an EventHandler during an event-dispatch. Any event handler that may
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 775
771 const GestureEventDetails& details() const { return details_; } 776 const GestureEventDetails& details() const { return details_; }
772 777
773 private: 778 private:
774 GestureEventDetails details_; 779 GestureEventDetails details_;
775 }; 780 };
776 781
777 } // namespace ui 782 } // namespace ui
778 783
779 #endif // UI_EVENTS_EVENT_H_ 784 #endif // UI_EVENTS_EVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698