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

Unified Diff: ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc

Issue 302093004: ozone: evdev: Don't crash without cursor in scroll & click events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
diff --git a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
index 503155a7c4396e7fb6801b0c4131a3cfd638b25a..11dd2d71fa5d5583b6e407b83d86bd2fe2f8b7bc 100644
--- a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
+++ b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
@@ -209,6 +209,8 @@ void GestureInterpreterLibevdevCros::OnGestureMove(const Gesture* gesture,
void GestureInterpreterLibevdevCros::OnGestureScroll(
const Gesture* gesture,
const GestureScroll* scroll) {
+ if (!cursor_)
+ return; // No cursor!
DVLOG(3) << base::StringPrintf("Gesture Scroll: (%f, %f) [%f, %f]",
scroll->dx,
scroll->dy,
@@ -255,6 +257,8 @@ void GestureInterpreterLibevdevCros::Dispatch(Event* event) {
void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int modifier,
bool down) {
+ if (!cursor_)
+ return; // No cursor!
const gfx::PointF& loc = cursor_->location();
int flag = modifiers_->GetEventFlagFromModifier(modifier);
EventType type = (down ? ET_MOUSE_PRESSED : ET_MOUSE_RELEASED);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698