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

Side by Side Diff: ui/events/gestures/gesture_provider_aura.cc

Issue 1989623002: Suppressed MEs for gestures from cancelled PEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed browser-side plumbing, added tests. Created 4 years, 6 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/gestures/gesture_provider_aura.h" 5 #include "ui/events/gestures/gesture_provider_aura.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 24 matching lines...) Expand all
35 35
36 auto result = filtered_gesture_provider_.OnTouchEvent(pointer_state_); 36 auto result = filtered_gesture_provider_.OnTouchEvent(pointer_state_);
37 if (!result.succeeded) 37 if (!result.succeeded)
38 return false; 38 return false;
39 39
40 event->set_may_cause_scrolling(result.moved_beyond_slop_region); 40 event->set_may_cause_scrolling(result.moved_beyond_slop_region);
41 pointer_state_.CleanupRemovedTouchPoints(*event); 41 pointer_state_.CleanupRemovedTouchPoints(*event);
42 return true; 42 return true;
43 } 43 }
44 44
45 void GestureProviderAura::OnTouchEventAck(uint32_t unique_event_id, 45 void GestureProviderAura::OnTouchEventAck(uint32_t unique_touch_event_id,
46 bool event_consumed) { 46 bool event_consumed) {
47 DCHECK(pending_gestures_.empty()); 47 DCHECK(pending_gestures_.empty());
48 DCHECK(!handling_event_); 48 DCHECK(!handling_event_);
49 base::AutoReset<bool> handling_event(&handling_event_, true); 49 base::AutoReset<bool> handling_event(&handling_event_, true);
50 filtered_gesture_provider_.OnTouchEventAck(unique_event_id, event_consumed); 50 filtered_gesture_provider_.OnTouchEventAck(unique_touch_event_id,
51 event_consumed);
51 } 52 }
52 53
53 void GestureProviderAura::OnGestureEvent( 54 void GestureProviderAura::OnGestureEvent(const GestureEventData& gesture) {
54 const GestureEventData& gesture) {
55 std::unique_ptr<ui::GestureEvent> event( 55 std::unique_ptr<ui::GestureEvent> event(
56 new ui::GestureEvent(gesture.x, gesture.y, gesture.flags, 56 new ui::GestureEvent(gesture.x, gesture.y, gesture.flags,
57 gesture.time - base::TimeTicks(), gesture.details)); 57 gesture.time - base::TimeTicks(), gesture.details));
58 58
59 if (!handling_event_) { 59 if (!handling_event_) {
60 // Dispatching event caused by timer. 60 // Dispatching event caused by timer.
61 client_->OnGestureEvent(gesture_consumer_, event.get()); 61 client_->OnGestureEvent(gesture_consumer_, event.get());
62 } else { 62 } else {
63 // Memory managed by ScopedVector pending_gestures_. 63 // Memory managed by ScopedVector pending_gestures_.
64 pending_gestures_.push_back(std::move(event)); 64 pending_gestures_.push_back(std::move(event));
(...skipping 16 matching lines...) Expand all
81 ui::EventTimeForNow(), 0.0f, 0.0f, 0.0f, 0.0f)); 81 ui::EventTimeForNow(), 0.0f, 0.0f, 0.0f, 0.0f));
82 gfx::PointF point(x, y); 82 gfx::PointF point(x, y);
83 touch_event->set_location_f(point); 83 touch_event->set_location_f(point);
84 touch_event->set_root_location_f(point); 84 touch_event->set_root_location_f(point);
85 85
86 OnTouchEvent(touch_event.get()); 86 OnTouchEvent(touch_event.get());
87 OnTouchEventAck(touch_event->unique_event_id(), true); 87 OnTouchEventAck(touch_event->unique_event_id(), true);
88 } 88 }
89 89
90 } // namespace content 90 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698