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

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

Issue 178193022: [Android] Always insert a TouchCancel if window or tab focus is lost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 9 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 <cmath> 7 #include <cmath>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 } 640 }
641 641
642 void GestureProvider::ResetGestureDetectors() { 642 void GestureProvider::ResetGestureDetectors() {
643 if (!current_down_event_) 643 if (!current_down_event_)
644 return; 644 return;
645 scoped_ptr<MotionEvent> cancel_event = current_down_event_->Cancel(); 645 scoped_ptr<MotionEvent> cancel_event = current_down_event_->Cancel();
646 gesture_listener_->OnTouchEvent(*cancel_event, false); 646 gesture_listener_->OnTouchEvent(*cancel_event, false);
647 scale_gesture_listener_->OnTouchEvent(*cancel_event); 647 scale_gesture_listener_->OnTouchEvent(*cancel_event);
648 } 648 }
649 649
650 void GestureProvider::CancelActiveTouchSequence() {
651 if (!current_down_event_)
652 return;
653 OnTouchEvent(*current_down_event_->Cancel());
654 current_down_event_.reset();
655 }
656
657 void GestureProvider::SetMultiTouchSupportEnabled(bool enabled) { 650 void GestureProvider::SetMultiTouchSupportEnabled(bool enabled) {
658 scale_gesture_listener_->set_ignore_detector_events(!enabled); 651 scale_gesture_listener_->set_ignore_detector_events(!enabled);
659 } 652 }
660 653
661 void GestureProvider::SetDoubleTapSupportForPlatformEnabled(bool enabled) { 654 void GestureProvider::SetDoubleTapSupportForPlatformEnabled(bool enabled) {
662 gesture_listener_->SetDoubleTapSupportForPlatformEnabled(enabled); 655 gesture_listener_->SetDoubleTapSupportForPlatformEnabled(enabled);
663 } 656 }
664 657
665 void GestureProvider::SetDoubleTapSupportForPageEnabled(bool enabled) { 658 void GestureProvider::SetDoubleTapSupportForPageEnabled(bool enabled) {
666 gesture_listener_->SetDoubleTapSupportForPageEnabled(enabled); 659 gesture_listener_->SetDoubleTapSupportForPageEnabled(enabled);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 void GestureProvider::EndTouchScrollIfNecessary(base::TimeTicks time, 803 void GestureProvider::EndTouchScrollIfNecessary(base::TimeTicks time,
811 bool send_scroll_end_event) { 804 bool send_scroll_end_event) {
812 if (!touch_scroll_in_progress_) 805 if (!touch_scroll_in_progress_)
813 return; 806 return;
814 touch_scroll_in_progress_ = false; 807 touch_scroll_in_progress_ = false;
815 if (send_scroll_end_event) 808 if (send_scroll_end_event)
816 Send(CreateGesture(ET_GESTURE_SCROLL_END, time, 0, 0)); 809 Send(CreateGesture(ET_GESTURE_SCROLL_END, time, 0, 0));
817 } 810 }
818 811
819 } // namespace ui 812 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_provider.h ('k') | ui/events/gesture_detection/gesture_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698