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

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

Issue 2843543002: Missing source pointer down events are handled. (Closed)
Patch Set: use of reference for the mandatory parameter. Created 3 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 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 #include "ui/events/gesture_detection/gesture_provider.h" 5 #include "ui/events/gesture_detection/gesture_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 const MotionEvent& secondary_pointer_down) { 685 const MotionEvent& secondary_pointer_down) {
686 // If there are more than two down pointers, tapping is not possible, 686 // If there are more than two down pointers, tapping is not possible,
687 // so Slop region is not deducted. 687 // so Slop region is not deducted.
688 DCHECK(ev2.GetPointerCount() < 3); 688 DCHECK(ev2.GetPointerCount() < 3);
689 689
690 gfx::Vector2dF delta(0, 0); 690 gfx::Vector2dF delta(0, 0);
691 for (size_t i = 0; i < ev2.GetPointerCount(); i++) { 691 for (size_t i = 0; i < ev2.GetPointerCount(); i++) {
692 const int pointer_id = ev2.GetPointerId(i); 692 const int pointer_id = ev2.GetPointerId(i);
693 const MotionEvent* source_pointer_down_event = 693 const MotionEvent* source_pointer_down_event =
694 gesture_detector_.GetSourcePointerDownEvent( 694 gesture_detector_.GetSourcePointerDownEvent(
695 ev1, secondary_pointer_down, pointer_id); 695 ev1, &secondary_pointer_down, pointer_id);
696 DCHECK(source_pointer_down_event); 696
697 if (!source_pointer_down_event) 697 if (!source_pointer_down_event)
698 continue; 698 continue;
699 int source_index = 699 int source_index =
700 source_pointer_down_event->FindPointerIndexOfId(pointer_id); 700 source_pointer_down_event->FindPointerIndexOfId(pointer_id);
701 DCHECK_GE(source_index, 0); 701 DCHECK_GE(source_index, 0);
702 if (source_index < 0) 702 if (source_index < 0)
703 continue; 703 continue;
704 float dx = source_pointer_down_event->GetX(source_index) - ev2.GetX(i); 704 float dx = source_pointer_down_event->GetX(source_index) - ev2.GetX(i);
705 float dy = source_pointer_down_event->GetY(source_index) - ev2.GetY(i); 705 float dy = source_pointer_down_event->GetY(source_index) - ev2.GetY(i);
706 delta += SubtractSlopRegion(dx, dy); 706 delta += SubtractSlopRegion(dx, dy);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 // null'ing of the listener until the sequence has ended. 912 // null'ing of the listener until the sequence has ended.
913 if (current_down_event_) 913 if (current_down_event_)
914 return; 914 return;
915 915
916 const bool double_tap_enabled = 916 const bool double_tap_enabled =
917 double_tap_support_for_page_ && double_tap_support_for_platform_; 917 double_tap_support_for_page_ && double_tap_support_for_platform_;
918 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); 918 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled);
919 } 919 }
920 920
921 } // namespace ui 921 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_detector.cc ('k') | ui/events/gesture_detection/gesture_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698