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

Side by Side Diff: ui/events/gesture_detection/gesture_detector.cc

Issue 2054193002: Android mouse events shouldn't appear as TouchEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a test, etc. 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // MSVC++ requires this to be set before any other includes to get M_PI. 5 // MSVC++ requires this to be set before any other includes to get M_PI.
6 #define _USE_MATH_DEFINES 6 #define _USE_MATH_DEFINES
7 7
8 #include "ui/events/gesture_detection/gesture_detector.h" 8 #include "ui/events/gesture_detection/gesture_detector.h"
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 sum_y += ev.GetY(i); 171 sum_y += ev.GetY(i);
172 } 172 }
173 const int div = pointer_up ? count - 1 : count; 173 const int div = pointer_up ? count - 1 : count;
174 const float focus_x = sum_x / div; 174 const float focus_x = sum_x / div;
175 const float focus_y = sum_y / div; 175 const float focus_y = sum_y / div;
176 176
177 bool handled = false; 177 bool handled = false;
178 178
179 switch (action) { 179 switch (action) {
180 case MotionEvent::ACTION_NONE: 180 case MotionEvent::ACTION_NONE:
181 case MotionEvent::ACTION_HOVER_ENTER:
182 case MotionEvent::ACTION_HOVER_EXIT:
183 case MotionEvent::ACTION_HOVER_MOVE:
184 case MotionEvent::ACTION_BUTTON_PRESS:
185 case MotionEvent::ACTION_BUTTON_RELEASE:
181 NOTREACHED(); 186 NOTREACHED();
182 return handled; 187 return handled;
183 188
184 case MotionEvent::ACTION_POINTER_DOWN: { 189 case MotionEvent::ACTION_POINTER_DOWN: {
185 down_focus_x_ = last_focus_x_ = focus_x; 190 down_focus_x_ = last_focus_x_ = focus_x;
186 down_focus_y_ = last_focus_y_ = focus_y; 191 down_focus_y_ = last_focus_y_ = focus_y;
187 // Cancel long press and taps. 192 // Cancel long press and taps.
188 CancelTaps(); 193 CancelTaps();
189 maximum_pointer_count_ = std::max(maximum_pointer_count_, 194 maximum_pointer_count_ = std::max(maximum_pointer_count_,
190 static_cast<int>(ev.GetPointerCount())); 195 static_cast<int>(ev.GetPointerCount()));
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 for (size_t i = 0; i < secondary_pointer_down_event.GetPointerCount(); i++) { 585 for (size_t i = 0; i < secondary_pointer_down_event.GetPointerCount(); i++) {
581 if (secondary_pointer_down_event.GetPointerId(i) == pointer_id) 586 if (secondary_pointer_down_event.GetPointerId(i) == pointer_id)
582 return &secondary_pointer_down_event; 587 return &secondary_pointer_down_event;
583 } 588 }
584 589
585 NOTREACHED(); 590 NOTREACHED();
586 return nullptr; 591 return nullptr;
587 } 592 }
588 593
589 } // namespace ui 594 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/blink_event_util.cc ('k') | ui/events/gesture_detection/gesture_event_data_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698